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

If I want to search for the ways and relations of highways and buildings within a bounding box, is this the most efficient way to write that query?

"[out:xml];(way[highway]({bbox});way[building]({bbox}););(._;>;);out;"

Or is there a more efficient way to specify the bounding box and the ways/relations I want within it? I'm using https://lz4.overpass-api.de/api/interpreter

Thanks for taking the time.

edit

To add some more context, we have an application where a user can toggle buildings, roads, railways...etc. So I need to be able to programatically peice together the query. So we get variations like:

"[out:xml];(way[railway]({bbox});way[building]({bbox}););(._;>;);out;"
"[out:xml];(way[highway]({bbox});way[building]({bbox}););(._;>;);out;"
"[out:xml];(way[building]({bbox}););(._;>;);out;"

asked 08 Jan '20, 20:35

kida001's gravatar image

kida001
31346
accept rate: 0%

edited 10 Jan '20, 14:08

TZorn's gravatar image

TZorn
12.3k764225

I think this is already the most efficient and most concise query. However I'm not an Overpass API expert.

(13 Jan '20, 13:41) scai ♦

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:

×147
×54

question asked: 08 Jan '20, 20:35

question was seen: 890 times

last updated: 13 Jan '20, 13:41

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