Question on how to calculate the length of all pedestrain walkways in a city?

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?


Thanks in advance!

1 Like

There is going to be some overlap between footway=sidewalk and highway=footway, as footway=sidewalk is a subset of highway=footway.

if sidewalk=both you probably should count the distance twice as this means that there are sidewalks on both sides of a street.

It depends on what you consider a “pedestrian walkway”, but you might include (highway=path, foot=designated) or simply highway=path.

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=footway footway=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.

1 Like

You may want to count highway=path foot=designated bicycle=designated ways.

And highway=cycleway foot=designated + highway=cycleway=foot=yes.

This covers things like footway and cycleway being one object, cycleway with allowed walking etc.

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.