In this study, Pedestrian Congestion and Pedestrian Safety are calculated separately. Pedestrian Congestion is derived based on the TTC, considering the safety occupation area. Pedestrian Safety, on the other hand, is assessed by setting minimum thresholds for distances between pedestrians and between pedestrians and vehicles. The premise is that, the closer the distance between moving objects on a backstreet, the higher the risk. Pedestrian Safety is calculated based on proxemics for pedestrian-to-pedestrian interactions, while pedestrian-to-vehicle safety is measured by counting instances where the TTC-based safety occupation areas overlap.
3.2.1. TTC and Safety Buffer
Pedestrian Congestion is calculated by comparing the total area of the backstreet with the safety occupation areas of pedestrians and vehicles. The safety occupation area refers not only to static space but to dynamic spatio-temporal changes, as the space occupied by each object varies every second. This dynamic area is determined by adding a safety buffer—based on speed, acceleration, and distance to the next movement point—to the minimum required space occupied by the object. Pedestrian Congestion is the ratio of the total safety occupation area of all observed objects to the total area, observed at specific time points. The intersections of these occupation areas are used later to calculate Pedestrian Safety.
To calculate the safety buffer based on the movement information of objects, this study employs TTC. TTC was first introduced by Hayward in 1971 [
26] and refers to the time remaining until a collision, assuming that the relative velocity and trajectory between two objects remain constant at a given time t [
27]. TTC has been widely used to assess traffic safety [
28]. The basic TTC calculation is shown in Equation (1). In this study, to account for scenarios where an object is either accelerating or not, we use Equation (2) from one of the latest studies on TTC by Wessels and Oberfeld [
29].
The original use of TTC calculates the expected time to collision between two distinct objects based on their speed, acceleration, and relative distance. However, in this study, TTC is used not to measure collision time between different objects, but to estimate the time it takes for an object to reach its next position 1 s later from its current position. This method allows us to calculate not only the minimum required space based on current speed and acceleration but also the necessary safety buffer to prevent collisions with other moving objects.
The data collection interval in this study is set to 1 s. Since the data are collected at 1 s intervals, the TTC used as the baseline for collision prediction is also set to 1 s. Using the object’s current attributes, such as speed and acceleration, we calculate the expected time to reach the next point 1 s ahead, which allows us to determine the safety buffer beyond the minimum required area for movement. In cases where TTC is calculated to be less than 1 s, the object is moving quickly, indicating that a larger safety buffer is required. If TTC is greater than 1 s, the object is moving more slowly, meaning a smaller safety buffer is sufficient.
Additionally, there are cases wherein TTC may be calculated as 0 or approaches zero, as well as cases where it is infinite. These indicate that the object’s current and future positions overlap, which, for two separate objects, would signify a collision. However, in this study, since we are calculating the trajectory of a single object at both its current and next positions, overlapping positions indicate that the object is stationary. In such cases, only the minimum required area for the stationary object is considered, without adding a safety buffer (Algorithm 1).
Algorithm 1 TTC and Buffer Area Calculation |
Function TTC (data, trajec_id, type_code) |
← distance between now and next point of data |
← speed of data |
← acceleration of data |
type_code ← type_code |
if then |
← ∞ |
elif then |
← if else ∞ |
else |
← |
← if else ∞ |
← 0 if else |
return |
|
Function BUFFER_AREA (ttc, object_length, object_width) |
► object_length, object_width are include safety length already |
width ← object_width |
length ← object_length |
minimum_area ← width·length |
if then ► Already considered as collided |
total_v ← minimum_area |
elif then ► Already considered as collided |
total_v ← minimum_area |
else |
safety_area ← minimum_area |
PSTA or VSTA ← safety_area + minimum_area |
return PSTA or VSTA |
Equations (3) and (4) are used to calculate the PSTA and VSTA. These areas are calculated on a per-second basis, and by integrating the per-second safety occupation area over the observation time t, the spatio-temporal area for the observed object over the observation time t is determined. Pedestrians and vehicles each have distinct minimum required areas, denoted by P and V, respectively.
The minimum required area for pedestrian (P) is calculated using the average shoulder width of 0.497 m and chest width of 0.313 m based on the anthropometric data of Koreans surveyed in 2021 [
30]. An additional buffer of 4 cm is added to account for lateral sway during walking [
16,
31]. For vehicles, the minimum required area (V) is determined using the standard dimensions of a passenger car in Korea, where the width and length are 1.7 m and 4.7 m, respectively, as specified by the Korean Ministry of Land, Infrastructure, and Transport. Additionally, a safety buffer of 2 m is added to both the width and length, resulting in final dimensions of 3.7 m and 6.7 m. The 2 m buffer corresponds to the minimum safe stopping distance typically maintained between a vehicle and a crosswalk on a road when the vehicle is stationary.
The Safety Occupation Spatio-Temporal Areas (PSTA and VSTA) vary depending on how the TTC changes relative to the 1 s threshold. According to Equation (2), if the acceleration is zero, the TTC and safety buffer are determined by the instantaneous speed of the trajectory point and the distance to the next point. The safety buffer added to the basic minimum required area depends on whether the acceleration is zero, positive, or negative.
3.2.3. Pedestrian Safety
- (1)
Ped-Ped Safety
Pedestrian-to-pedestrian (Ped-Ped) safety is assessed by identifying potential threats when one pedestrian’s personal space, as defined by proxemics, is encroached upon by another pedestrian (
Table 1). This is quantified by counting the number of opposing-direction trajectories that come within 1.2 m of each trajectory point. The threshold of 1.2 m is derived from the four spatial zones outlined in proxemics [
19]. Distances exceeding 1.2 m fall within the social or public space, which is more appropriate for interactions in environments where encounters with strangers are common and unremarkable. In contrast, personal space—defined as the area within 1.2 m—is generally reserved for interactions with familiar individuals. As noted in [
32], objective measures of spatial boundaries, such as personal space, have a stronger correlation with human behavior in built environments than subjective perceptions. These spatial boundaries significantly influence walking patterns and perceptions of safety. In this context, a breach of personal space by unfamiliar individuals can cause discomfort, especially in shared public spaces where interactions are often involuntary. Only interactions between pedestrians moving in opposite directions are analyzed, based on walking direction (0: same direction, 1: opposite direction). This approach assumes that pedestrians traveling in the same direction are more likely to be companions, while those moving in opposite directions are more likely to evoke feelings of discomfort or unfamiliarity when invading each other’s personal space.
- (2)
Ped-Vehi Safety
Ped-Vehi Safety is calculated by counting the number of instances where the TTC-based safety occupation areas of pedestrians and vehicles overlap. The direction of movement for both pedestrians and vehicles is not considered in this calculation, as the risk of collision increases regardless of direction when pedestrians and vehicles are in close physical proximity. Ped-Vehi Safety is determined by aggregating the intersections of PSTA and VSTA, with higher counts indicating a greater number of potential collision points between pedestrians and vehicles. Ped-Vehi Safety and Pedestrian Congestion are calculated simultaneously to enhance computational efficiency. By using spatial join techniques, we reduce unnecessary repeated calculations and increase the computational speed by processing both algorithms in parallel.
Algorithm 2 presents the pseudocode for the algorithm that simultaneously calculates Pedestrian Congestion and Ped-Vehi Safety. It begins by generating geometric buffers for PSTA and VSTA based on TTC. The TTC-based geometric buffers are created by calculating the buffer radius as using the PSTA and VSTA areas for pedestrians and vehicles, respectively, and applying this radius to generate geometric buffers around each point. Then, it joins these buffers to compute both the intersections and unions. To identify overlapping areas between pedestrian and vehicle buffers, a spatial join operation is performed using the sjoin function from GeoPandas, with the predicate intersects to locate intersecting regions. Additionally, to calculate the total safety occupation area, the unary union function from the Shapely library is applied to unify pedestrian and vehicle buffers, avoiding overlap duplication when computing the union.
Both pedestrians and vehicles are present: Ped-Vehi Safety is calculated as the intersection of PSTA and VSTA, while Pedestrian Congestion is calculated with the sum of the PSTA and VSTA areas.
Only pedestrians are present: Ped-Vehi Safety returns 0, and Pedestrian Congestion is calculated with the sum of the PSTA areas.
Only vehicles are present: Ped-Vehi Safety returns 0, and Pedestrian Congestion is calculated with the sum of the VSTA areas.
No objects are present: Both Ped-Vehi Safety and Pedestrian Congestion return 0.
This structure ensures that both safety and congestion metrics are efficiently computed for varying conditions, accounting for the interactions between pedestrians and vehicles on shared road spaces.
Algorithm 2 Calculating Buffered Geometry and Intersections |
Function CALCULATE_TTCBUFFER_GEOMETRY(df) |
Create a GeoDataFrame from the DataFrame and apply the buffer |
Convert the coordinate reference system to “EPSG:5179” to calculate buffer as a meter |
Calculate the buffer radius from the buffer area using the formula: |
Apply the buffer to the geometry using the calculated radius |
Set the buffered geometry as the default geometry column |
Create a spatial index for the GeoDataFrame |
return geo_pd |
|
Function CALCULATE_INTERSECTION(pedestrian, vehicles) |
Check if the pedestrian DataFrame is not composed only of NaN values |
if pedestrian DataFrame is not NaN then |
Check if the vehicles DataFrame is not composed only of NaN values |
if vehicles DataFrame is not NaN then ► Both pedestrians and vehicles exist |
Calculate the buffered geometry for pedestrians |
Calculate the buffered geometry for vehicles |
Perform a spatial join to find intersecting objects using the predicate “intersects” |
Combine all pedestrian and vehicle buffers and calculate the union of these buffers |
Calculate the area of the union |
Return intersections.shape[0], union_area |
else ► Only pedestrians exist |
Calculate the buffered geometry for pedestrians |
Calculate the union of all pedestrian buffers |
Calculate the area of the union |
Return 0, union_area |
end if |
else |
Check if the vehicles DataFrame is not composed only of NaN values |
if vehicles DataFrame is not NaN ► Only vehicles exist |
Calculate the buffered geometry for vehicles |
Calculate the union of all vehicle buffers |
Calculate the area of the union |
return 0, union_area |
else ► Neither pedestrians nor vehicles exist |
return 0, 0 |
end if |
end if |