1

I'm trying to filter the result of an Overpass union using a bounding box.

This works:

(
  rel["natural"="wood"]({{bbox}});
  rel["landuse"="forest"]({{bbox}});
);
(._;>;);
out;

But it requires me to repeat the bounding box twice (or even more often when there are additional queries in the union). Therefore, I'd like to apply the filter after the union, which doesn't seem to work:

(
  rel["natural"="wood"];
  rel["landuse"="forest"];
)({{bbox}});
(._;>;);
out;

The error message I get is

Error: line 4: parse error: ';' expected - '(' found. 
4
  • Please refer to the documentation, keyword is "Global Bounding Box". What do you mean by "Turbopass union"??? overpass turbo is the name of the web frontend, Overpass API is the database backend serving the data, and union is a language construct provided by Overpass API. – mmd Jul 19 '18 at 11:14
  • @mmd I've fixed the "Turbopass union" typo, thanks for pointing it out! If I understand it correctly, using a Global Bounding Box would set the bounding box for all my queries -- this means I couldn't have two separate unions with different bounding boxes. – Florian Brucker Jul 19 '18 at 11:58
  • Yes, that's correct, a global bounding box setting applies to all statements, like in your example. From your question, it's not really obvious that you want to use different bounding boxes for different statements. The only thing you could do is to add additional bounding boxes to single statements to further restrict your global bounding box. – mmd Jul 19 '18 at 12:56
  • Thanks for the clarification, @mmd! If you post that as an answer I'd be happy to accept it. – Florian Brucker Jul 19 '18 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.