Search code examples
openstreetmapoverpass-api

How do a query for a bridge longer or short than x?


Ist there a way to query for the length of a bridge in Overpass QL?

Bridges seem to come with the length argument, but maybe it's not widely in use?

["bridge:length"=100]

In addition, how can a query for a length longer or small than a given number?


Solution

  • Rather than using some rarely used tag that isn't even documented on the OSM wiki, you should calculate the actual length of a way using length(). See this Help OSM post for some ideas: https://gis.stackexchange.com/questions/325159/how-to-calculate-the-length-of-each-way-in-a-set-in-overpass-use-of-foreach-an

    Working with numbers is described in this blog post: http://dev.overpass-api.de/blog/numbers.html