Apple Turnover is a tool that performs basic analysis on the attributes of turn lanes in OpenStreetMap.
With Apple Turnover, you can gather statistics about the lengths of turn lanes by speed limit, highway classification, or other attributes. Apple Turnover contains the following all-natural ingredients:
- Recognizes
:forward
,:backward
, two-way, and one-way turn lane data - Correctly handles left and right turn lanes on the same road in which the lanes’ start and end points are staggered
- Spans maneuvers across multiple ways split due to changes in lane count, speed limit, name, etc.
- Consolidates maneuvers that are multiple lanes wide
- Distinguishes between segments of turn lanes that allow and disallow lane changes
- Clone this repository and run
npm install
to install this tool’s dependencies. - Using Overpass turbo, query for turn lanes in a specific region in which turn lanes have been mapped. Examples:
- Click the Export button. Under the Data section, choose “raw data” and save the file to disk.
- Run the following command to analyze the exported file and output the results:
If no output file is specified, the tool outputs to the command line.
node index.js export.json output.csv
The output file is a tab-delimited file. Each line represents one maneuver, such as a left turn or right turn. Only explicitly tagged maneuvers (i.e., turn:lanes:forward
) are accounted for. The file has the following columns:
- ID of the node at the beginning of the turn lane
- ID of the node at the end of the turn lane, where the driver turns
left
,right
, orreverse
, as indicated by lane markings or signage; combinations of maneuvers, such asleft;right
, result in separate maneuvers- The
highway
tag of the way at the end of the turn lane - The
highway
tag of the way onto which the driver turns (the cross street) - The number of lanes that may be used for this maneuver
- The length (in meters) of the turn lane
- The length (in meters) of the portion of the turn lane that is surrounded by lane change restrictions; left blank if the entire lane is subject to lane change restrictions
- The explicit maximum speed limit (in meters per second) along the turn lane; if the speed limit varies along the turn lane, an average weighted by distance