Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying 'if' block statements in Overpass API #22

Closed
EsbernJakobsen opened this issue Sep 30, 2020 · 2 comments
Closed

Querying 'if' block statements in Overpass API #22

EsbernJakobsen opened this issue Sep 30, 2020 · 2 comments

Comments

@EsbernJakobsen
Copy link
Contributor

Using Overpass Turbo you can add if block statements to query by conditions. For example, if I want all roads that include tunnels, I can query:
way["tunnel"="yes"]["highway"](if: length() > 80)(area); out;

Currently, I don't believe there is any way to do this using the overpassQueryBuilder.
If you add this 'if' block to the selector argument, the 'if' block becomes enveloped in [] in the query string:
way["tunnel"="yes"]["highway"][(if: length() > 80)](area.searchArea););
This causes an error.

Is there currently any functionality to support 'if' block conditions when querying the Overpass API?

@mocnik-science
Copy link
Owner

Sadly, there has not been implemented such functionality. I would suggest to not use the overpassQueryBuilder in this (and similar cases) but write the query as a string. Sorry.

@EsbernJakobsen
Copy link
Contributor Author

No worries, if I have time I might have a look at the code and see if I can implement something !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants