This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

overpass query for sidewalks widths within a range

1

Hello everybody, I want to make an overpass query which shows me the sidewalks which the width attribute is for example 0.80 m to 0.90 m for them.


( way["footway"="sidewalk"] ["width"="0.81 m"] ({{bbox}}); );


the above mentioned code shows only the side walks with the 0.81 m of width. how can I modify my code to search for a range of widths?

thank you in advance

asked 16 Jun '21, 12:18

Ahmad%20Ataei's gravatar image

Ahmad Ataei
31114
accept rate: 0%


2 Answers:

3

answered 17 Jun '21, 01:03

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Thanks Dave. I solved my problem using this link.

Best,,,

(21 Jun '21, 10:24) Ahmad Ataei

1

Not sure if there is something like range matching but I guess you could use a regular expression if you are not too picky about the ranges. To find 0.8 to 0.99m you could for example look for

( way["footway"="sidewalk"]["width"~"^0\.[89]"] ({{bbox}}); );

That would find all values starting with 0.8 or 0.9.

Unfortunately very few sidewalks around here have a width tagged at all so I could not test that expression. Can you point to the aeria you are exploring?

answered 16 Jun '21, 15:14

TZorn's gravatar image

TZorn
12.3k764225
accept rate: 15%

Dave's suggestion with the numerical evaluation is probably the better approach.

(17 Jun '21, 09:08) TZorn

Thank you for your answer. as you mentioned dave's suggestion is more precise and generalised but your suggestion was working in my case. I'm Workington this area: https://www.openstreetmap.org/way/404140219

Best,,,

(21 Jun '21, 10:30) Ahmad Ataei

Source code available on GitHub .