# 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?

``````        way["footway"=sidewalk](area.a);
way["sidewalk"=both](area.a);
way["sidewalk"=left](area.a);
way["sidewalk"=right](area.a);
way["footway"=crossing](area.a);
way["footway"=traffic_island](area.a);
way["footway"=alley](area.a);
way["footway"=residential](area.a);
way["highway"=footway](area.a);
way["highway"=pedestrian](area.a);
``````

-Kuba

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.

## 800Ă—568 120 KB

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.

2 Likes