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

I'm trying to figure out the syntax of overpass-turbo query. I have found a couple of queries.

One that ends with out body center qt:

[out:json][timeout:600]; ( node["craft"="window_construction"]; way["craft"="window_construction"]; relation["craft"="window_construction"]; node["craft"="carpenter"]; way["craft"="carpenter"]; relation["craft"="carpenter"]; ); out body center qt;

And one that has ;> at the end of every row and that ends with out skel qt:

[out:json][timeout:600]; ( node["craft"="window_construction"];>; way["craft"="window_construction"];>; relation["craft"="window_construction"];>; node["craft"="carpenter"];>; way["craft"="carpenter"];>; relation["craft"="carpenter"];>; ); out skel qt;

It seems to produce the same output. Can you tell me what's the difference? And what does it change if I just end the query with just out?

asked 24 Jul '23, 16:30

Andreanovenove's gravatar image

Andreanovenove
126101118
accept rate: 0%

edited 24 Jul '23, 16:31


The documentation for the out statement is here. I think in the second output all the tags are missing.

the > is meant to recurse down to get e.g. nodes for all ways. I have never seen this used at the end of every line of a set of queries being aggregated. A more typical use might be the one used in the equivalent Query Wizard output:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“craft=window_construction OR craft=carpenter”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “craft=window_construction”
  node["craft"="window_construction"]({{bbox}});
  way["craft"="window_construction"]({{bbox}});
  relation["craft"="window_construction"]({{bbox}});
  // query part for: “craft=carpenter”
  node["craft"="carpenter"]({{bbox}});
  way["craft"="carpenter"]({{bbox}});
  relation["craft"="carpenter"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
permanent link

answered 24 Jul '23, 23:42

InsertUser's gravatar image

InsertUser
11.0k1369185
accept rate: 19%

Thank you for your reply. Can you tell me why you said in the second query all the tags are missing? Why is there a double out in the wizard query you posted?

(25 Jul '23, 08:22) Andreanovenove

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:

×228
×205
×191
×147
×3

question asked: 24 Jul '23, 16:30

question was seen: 476 times

last updated: 25 Jul '23, 08:22

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