NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hey,

Is it possible to factor in the length of a way in Overpass API query? For example querying for ways that are highway=service and that are longer than 100m.

Thanks in advance!

asked 10 Aug '14, 08:09

kerosin's gravatar image

kerosin
411131627
accept rate: 0%

How do you define a way? An OSM way where a single street can consist of many individual ways? A part of a street up to the next intersection? A whole street consisting of multiple OSM ways all having the same name? Something else?

(11 Aug '14, 08:40) scai ♦
1

I was talking about OSM ways - not streets. So a way is a set of nodes that are connected and that (in my case) don't form an area. A street can exist of one or more way(s). So basically I meant ways as there're defined for overpass queries (just without areas).

(11 Aug '14, 08:54) kerosin

Unfortunately, it's not possible to specify the length of a way as filter criterion in Overpass API. You need to resort to some kind of post-processing, e.g. using PostGIS or something similar.

permanent link

answered 10 Aug '14, 08:35

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

permanent link

answered 11 Aug '14, 18:12

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

permanent link

answered 18 Nov '19, 12:04

jidanni's gravatar image

jidanni
339323647
accept rate: 0%

You can add length data to the output of an overpass query, see https://github.com/drolbr/Overpass-API/issues/237#issuecomment-303974281

permanent link

answered 25 Sep '21, 11:15

tordans's gravatar image

tordans
111
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×228
×147

question asked: 10 Aug '14, 08:09

question was seen: 10,520 times

last updated: 25 Sep '21, 11:15

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum