2

I try to find all hotels in my area with more than X rooms.

This is my attempt:

[out:json][timeout:25];
// gather results
nwr["tourism"="hotel"]({{bbox}});

(
  way["building"]({{bbox}});
  way["building:shape"!="square"]({{bbox}});
)->.all_buildings;

// filter hotels without square shape
way.all_buildings["tourism"="hotel"]["rooms" > 2];
out geom;

Error:

An error occurred while executing the Overpass Query! The Overpass API returned the following message:

Error: line 11: parse error: '!', '~', '=', '!=', or ']' expected - '>' found.

1 Answer 1

2

The > character is for recursing down, not greater than.

You can look at this post to see how value operators work:

https://dev.overpass-api.de/blog/numbers.html

In short, you have to use a numerical comparator by using this line at the end of your code:

// filter hotels without square shape
way.all_buildings["tourism"="hotel"][rooms](if:t["rooms"]>4);
out geom;

(see also question Using Overpass Turbo to return all peaks over certain elevation)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.