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

How can I get all the nodes and ways within some polygon in a single Overpass API query? For example, I can get all the ways like this;out;) and all the nodes like this.

But how might I combine these HTTP GET requests into a single query?

asked 28 Sep '16, 17:03

gboeing's gravatar image

gboeing
1366613
accept rate: 0%


Take a look at the union operator:

http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Union

You will have to repeat the poly statement. Here's the poly example from the docs wrapped in a union:

(
  node(poly:"50.7 7.1 50.7 7.2 50.75 7.15");
  way(poly:"50.7 7.1 50.7 7.2 50.75 7.15");
  rel(poly:"50.7 7.1 50.7 7.2 50.75 7.15");
);
permanent link

answered 28 Sep '16, 22:04

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Thanks, yes, the wrapping parentheses were what I needed.

(29 Sep '16, 03:18) gboeing

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
×362
×290
×228
×85

question asked: 28 Sep '16, 17:03

question was seen: 6,622 times

last updated: 29 Sep '16, 03:18

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