# Predicting Pedestrian Crashes in Texas' Intersections and Midblock Segments
## 3 Geometry Estimation
### Midblock Segments and Intersections  
To support research analysis efforts, an underlying representation of roadway segments is prepared, and pedestrian-related crashes nearest to these segments are then associated with them. A geographic database of road segments with \"multi-line string\" geometry found in the TxDOT Roadway Inventory serves as the starting representation for all roadways in Texas. Each of these come labeled with street name, physical roadway characteristics, such as functional class and lane count, estimated daily traffic volume, and maintenance information. In that inventory, each roadway consists of one or more segments. These segments are generally bidirectional except for those that represent one-way streets and divided highways. A challenge in using the TxDOT Roadway Inventory is that individual roadway segments may be extremely short--a minimum of 5 feet--to represent a high rate of changes in inventory values along a roadway, or extremely long--up to 44 miles--for roadways that see few changes. Project activities benefit from the use of fairly consistently spaced segments, necessitating a remapping effort to create derived datasets of mostly uniform segments. Uniform segments of 1-mile length are selected as an appropriate length for the state-wide analysis. Selecting a shorter length would divide the network into a large number of segments, with multiple segments containing zero crashes. This would affect the performance of the models, since a large number of segments with zero crashes would create a higher unbalanced sample. For the city-level analysis, 0.1-mile segments are used to provide a more detailed analysis of the area. In each set, key criteria of the underlying segments that overlap the most from the TxDOT Roadway Inventory are mapped to these new segments. To create these, an algorithm divides up roadways into a new set of segments targeted at length \(L\). Since these characteristics vary from segment to segment, slicing multiple \"original\" segments is avoided to preserve the original characteristics at maximum. Therefore, a tolerance level of 25% is established, meaning that some segments are allowed to be \(\pm\)0.25 \(L\) following these rules:  
* If the original roadway is less than 1.25 \(L\) miles, then the derived roadway is represented with one segment of the same length. * If the original roadway is less than 2 (1.25 \(L\)) miles, then the derived roadway is represented with two segments of equal length. * Otherwise, the derived roadway is represented as starting and ending with segments no less than 0.75 \(L\) miles on either end, with \(L\)-mile segments in-between. Mapping locations of crashes to nearby intersections is also important for this research to distinguish from midblock crashes. Unfortunately, the TxDOT Roadway Inventory does not offer explicit intersection point geometry. Although one can analyze the Roadway Inventory to evaluate where roadway segments intersect, it is impossible to understand where bridges exist (especially near expressway interchanges), leading to numerous false-positive intersections, especially around expressways. OpenStreetMap [18] was leveraged to positively map intersection and signal locations and apply them to appropriate locations in the TxDOT Roadway Inventory geometry. In terms of traffic control, the intersection geometry estimation accounts for signalized intersections versus non-signalized ones. Still, it does not include stops or yield sign details as it is challenging to obtain this information at the state level from OpenStreetMap. To estimate intersections,queries to a local instance of the Overpass API [19] were created among approx. 30 \(\times\) 30-mile tiles to return all candidate intersection seed points throughout Texas (Figure 2 provides a flowchart of the methodology). The initial set came with caveats: many OpenStreetMap intersections on divided roads of all types exist for each direction. In contrast, the intersections needed for the TxDOT Roadway Inventory would be needed per roadway.