Hello! I am new to OSM and am tryng to leverage it to calculate the total length of pedestrian walkways (i.e., footways/sidewalks) within individual cities. I am using OSM wiki to determine which keys I should be using to account for all type of paths (Key:highway - OpenStreetMap Wiki).
The code below show the types of paths I am summing to get the total length of all pedestrians paths in the city. However I am not sure if I am covering all my bases or double counting certain paths. Will the below list of keys get me the total sidewalk length across a city, or should I add/remove any?
Yes, in fact, any way with footway=* set to anything will already have highway=footway, so you’re already including all of them by looking for highway=footway. You’d still need to look for sidewalk=* explicitly because those are tagged on roadways, such as highway=residential.
Some assorted notes:
sidewalk=separate just means there’s a highway=footwayfootway=sidewalk way has already been mapped beside the roadway, so you don’t need to count sidewalk=separate. In your query, this can look like way["sidewalk"]["sidewalk"!="separate"].
An alternative syntax is sidewalk:both=yes, sidewalk:left=yes, or sidewalk:right=yes. You might need to include those tags for an accurate count.
Some highway=pedestrian ways might actually be areas representing pedestrian malls or plazas. You’d detect them by area=yes. The “length” of these areas would be their perimeters. But typically a highway=footway way has been mapped redundantly through any plaza, and possibly any mall, for routing purposes, so you might be able to ignore them. In a typical U.S. city, these would be a small fraction of the walkable paths anyways.
And just to reiterate: results will be highly influenced by how well mapped are various places.
Some places have carefully mapped all footways in cemeteries, this may skew results a bit compared to places where sidewalks exists but noone mapped them.
In a few U.S. cities, highway=steps (for public staircases) add up to a non-negligible distance. There’s a long tail of infrastructure that could be considered walkable.