12  Pedestrian Activity in a Commercial District

The preceding chapters demonstrated the five metrics on a university campus. This case study applies two of them, activities and revisits, to a different urban context: a commercial district with both pedestrian-priority and conventional streets. The question: where do people stay, and does it differ between one-time and returning visitors?

The figure below summarizes the main findings.

Pedestrian activity in a commercial district near the University of Ulsan. (a) Sensor map: fill color = stay ratio, size = trajectory count; blue line = pedestrian-priority street. (b) Per-sensor stay ratios grouped by street type. (c) Stay ratio by visitor frequency and street type; diamonds mark the weighted mean; gap labels show the pedestrian-priority lift.

Sensors on the pedestrian-priority street consistently show higher stay ratios than those on conventional streets (a, b). The overall stay ratio on pedestrian-priority streets is 13.6%, nearly 60% higher than the 8.6% on conventional streets. More notably, this advantage is not uniform across visitor types: one-time visitors show a +7.9 pp lift on the pedestrian-priority street, nearly double the +4.0 pp lift for returning visitors (c), suggesting the street design particularly encourages newcomers to linger.

The rest of this chapter walks through the analytical steps behind this figure.

12.1 Study site

The study site is a commercial district near the University of Ulsan, South Korea. A designated pedestrian-priority street (~400 m) runs north–south through the district core, flanked by conventional streets with mixed vehicle and pedestrian traffic. The pedestrian-priority street hosts restaurants and small retail shops; the surrounding streets serve similar functions but without vehicle restrictions.

Seventeen WiFi sensors were deployed across the district over 9 valid days (July 2020): eight on the pedestrian-priority street and nine on conventional streets. The dataset contains approximately 17.9 million probe-level records from over 75,000 unique non-randomized devices at 1-second resolution.

The data (wifi_uou20_1sec.csv) contains 1-second compressed WiFi probe requests. Sensor locations and street-type labels are stored in sensors_coords.csv. A bus-stop overlay (poi_uou.gpkg) marks transit access points. The full analysis is in scripts/9-2-figure3.R.

12.2 Data pipeline

The stay detection pipeline follows the same logic as Chapter 11 (localize, build trajectories, cluster spatially, classify by duration), but with parameters adapted for the denser sensor network in this commercial district.

Localization

Each 1-second detection is aggregated into 20-second windows. Within each window, the sensor with the highest RSSI sum is selected as the device’s location.

Trajectories and quality filter

Detections are grouped into trajectories using a 2-hour gap threshold: if a device goes undetected for more than 2 hours, a new trajectory begins. The gap is longer than the campus setting (30 minutes) because commercial visits often include extended indoor stays during which street-level sensors lose the device; a shorter gap would split a single visit into several trajectories. A quality filter retains only trajectories with at least 2 sensors and between 1 minute and 2 hours of duration.

Anchor clustering

Sensor spacing in this district is much tighter (46–95 m nearest-neighbor) than on campus (63–147 m), so the distance threshold is lowered to 75 m, just above the typical nearest-neighbor spacing (46–63 m for 15 of the 17 sensors; two peripheral sensors sit at 87 and 95 m). Adjacent-sensor ping-ponging merges into a single cluster, while genuine movement triggers a break.

The campus deployment (Chapter 11) used 150 m, just above its widest nearest-neighbor spacing (~147 m) and on the order of the sensor detection range. Here, nearest-neighbor distances run from 46 m to 95 m, with 15 of the 17 sensors within 63 m of their nearest neighbor. Setting \(\theta_d\) at 75 m means:

  • Two adjacent sensors ($$75 m) merge: ping-ponging resolved
  • Non-adjacent sensors (>75 m) break: genuine movement detected

A higher threshold (e.g., 100 m) would over-merge: a device walking past three consecutive sensors might stay in one cluster despite clearly moving through the district.

Stay classification

Clusters lasting 5 or more minutes are classified as stays, following the public life study convention (Gehl and Svarre 2013). Each stay is assigned to its primary sensor, the sensor with the most detections within the cluster.

12.3 Street type comparison

Pedestrian-priority sensors show a stay ratio of 13.6% across all trajectory–sensor pairs, compared to 8.6% on conventional streets.

type_result <- traj_sensor |>
  group_by(street_type) |>
  summarise(
    n_traj_sensor = n(),
    n_stay        = sum(is_stay),
    stay_rate     = round(mean(is_stay) * 100, 1),
    n_devices     = n_distinct(source_address),
    .groups = "drop"
  )
  street_type  n_traj_sensor  n_stay  stay_rate  n_devices
  Pedestrian          84,382  11,448       13.6     26,730
  Regular            196,896  16,977        8.6     39,101

This difference holds at the individual sensor level (panel b). When sensors are grouped by street type, pedestrian-priority sensors (median ~12%) sit systematically above conventional sensors (median ~8%). No conventional sensor exceeds the pedestrian-priority median, confirming a consistent spatial pattern rather than a few outlier sensors driving the aggregate.

12.4 Visit frequency classification

The street type comparison shows where people stay, but not who is staying. A high stay ratio on the pedestrian-priority street could reflect returning visitors who always linger regardless of street design (a population effect), or the street design itself encouraging stays among all visitors (a design effect). To disentangle these, we classify devices by how often they appear, then compare stay behavior within each group.

Residential filter

Before classifying visit frequency, we remove residential devices: those detected during night hours (0–4 AM) on 3 or more days. These likely live in apartments within sensor range and would dominate the “returning” category without actually being commercial district visitors.

residential <- wifi |>
  filter(hour(timestamp) %in% 0:4) |>
  distinct(source_address, date) |>
  count(source_address, name = "night_days") |>
  filter(night_days >= 3) |>
  pull(source_address)

wifi <- wifi |> filter(!source_address %in% residential)

Distribution of detection days

Among non-residential devices, the number of distinct detection days per device is heavily right-skewed.

Distribution of detection days per device. Over half of non-residential devices (57.7%) appear on exactly one day; the sharp drop-off after day 1 supports a binary classification.

Over half of non-residential devices (57.7%) appear on exactly one day, and the count drops sharply at day 2 (~14%). This motivates a binary split rather than the three-category scheme used on campus (Chapter 10): one-time visitors (1 day; 42,659 devices, 57.7%) and returning visitors (2+ days; 31,278 devices, 42.3%, median 3 days).

visit_freq <- wifi |>
  distinct(source_address, date) |>
  count(source_address, name = "n_days") |>
  mutate(visit_type = if_else(n_days == 1L, "Single-day", "Multi-day"))

The campus analysis used three categories (one-time, occasional, returning) over a 7-day window (Chapter 10) because campus visitors have structured weekly routines that produce a gradual frequency gradient. This commercial district serves a different population: the sharp drop after day 1 suggests the most meaningful behavioral boundary is simply between “came once” and “came back.”

The 42.3% returning rate also rests on stable addresses: in this deployment (July 2020, before iOS 14’s default-on rollout), randomized addresses accounted for 22.3% of detections (Section B.3) and were removed in preprocessing, so multi-day persistence among retained devices reflects genuine repeat visitors rather than randomization artifacts.

12.5 Visit frequency by street type

With visitors classified, we can now ask whether the pedestrian-priority advantage holds equally for both groups. Panel (c) shows the answer as a dumbbell chart. One-time visitors stay at 8.0% on conventional streets but jump to 15.9% on pedestrian-priority streets, a gap of +7.9 percentage points. Returning visitors show a smaller shift, from 8.8% to 12.8% (+4.0 pp).

traj_sensor_freq <- traj_sensor |>
  inner_join(visit_freq |> select(source_address, visit_type),
             by = "source_address")

freq_cross <- traj_sensor_freq |>
  group_by(visit_type, street_type) |>
  summarise(
    n_traj_sensor = n(),
    n_stay        = sum(is_stay),
    stay_rate     = round(mean(is_stay) * 100, 1),
    n_devices     = n_distinct(source_address),
    .groups = "drop"
  )

The pedestrian-priority lift is nearly double for one-time visitors (+7.9 pp) compared to returning visitors (+4.0 pp). On conventional streets the two groups behave almost identically (8.0% vs. 8.8%), so the gap opens specifically on the pedestrian-priority street. This pattern points toward a design effect: the street environment itself, not just the habits of repeat visitors, appears to support the higher stay ratio.

Why would one-time visitors respond more strongly to the pedestrian-priority street? Returning visitors have established routines; they may visit specific shops regardless of street design. One-time visitors, lacking such routines, may be more influenced by environmental cues: wider sidewalks, slower traffic, outdoor seating, and other design elements that signal “this is a place to linger.” This interpretation aligns with the public life literature (Gehl and Svarre 2013): good street design matters most for uncommitted pedestrians, those who have not yet decided whether to stay or keep walking.

12.6 Notes

The stay ratio metric, the share of trajectory–sensor pairs classified as stays, differs from the timeslot-based approach used with coarser data. The 1-second resolution enables proper trajectory construction and spatial clustering, resolving ping-ponging artifacts that would inflate stay counts with 10-minute aggregated data.

The visit frequency classification relies on persistent MAC addresses. Randomized addresses were removed in preprocessing via the locally-administered bit (Chapter 5), and the trajectory quality filter (at least 2 sensors, 1 min–2 hr duration) removes residual artifacts, which typically appear as single-detection, single-sensor events. The deployment itself (July 2020, South Korea) also predates iOS 14’s default-on randomization rollout.

The analytical pattern extends Chapter 11 by adding a second dimension of comparison. Segmenting detections into stays and pass-throughs reveals where activities concentrate; layering visit frequency classification (Chapter 10) on top reveals that the street design effect is not uniform across visitor types. The full analysis code is available in scripts/9-2-figure3.R.