2

I want to use overpass turbo to query data within a certain range of numerical attribute values. For example, I want to find power=line elements with voltage in a range between 100kV and 200kV.

I would have expected that a query like this

way
  [power=line]
  [voltage>100000]
  [voltage<200000]
  ({{bbox}});
(._;>;);
out;

would yield such results. But in this case I receive the error message,

parse error: '!', '~', '=', '!=', or ']' expected - '<' found.

so I presume that > and < operators are not allowed here. Is there any way around this?

1 Answer 1

3

According to the Overpass GitHub, there has already been a request for using those operators directly.

However, you can use a regular expression to obtain voltage between 100kV and 200kV:

way
  [power=line]
  [voltage~"^[1][0-9]{5}$"]
  ({{bbox}});
(._;>;);
out;

Overpass

Your Answer

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

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