This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Some questions about overpass-turbo query

0

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


One Answer:

1

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;

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

Source code available on GitHub .