Overpass turbo - usage of inequalities rather than equalities.

How can I, with overpass turbo, use an inequality rather than an equality. For example if I’m looking for all villages higher than 700m above seal level I’d like to be able to do something such as:


[out:json][timeout:25];
// gather results
(
  // query part for: “place=village and ele=700”
  node["place"="village"]["ele">"700"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Another example if if I’d also be looking for railways with a gauge wider than standard gauge (1435mm). I’d like to do the following request:

[out:json][timeout:25];
// gather results
(
  way["railway"="rail"]["gauge">"1435"]({{bbox}});
  relation["railway"="rail"]["gauge">"1435"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

However such a thing is not possible, as only = and ~= work. Inequalities are not supported. I understand that tags are technically strings and not integers, so perhaps converting the strings to integers should be necessary before a comparison is possible, but I don’t know how to achieve that.

Thanks in advance for helping.

I don’t know the internal structure of overpass, but this could be an extreme performance hit. If it uses indexes, it may force a brute force search, and if some brute force searching is already needed, it will increase the computational cost because of the need to parse the values.

Numeric comparisons are already possible with release 0.7.55 as of today. Please refer to the documentation and the following blog posts for details:

http://dev.overpass-api.de/blog/numbers.html
http://dev.overpass-api.de/blog/more_numbers.html
https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Number_Check.2C_Normalizer_and_Suffix

NB: Your thread title “inequalities” is a bit misleading, that’s something different and uses operator " != " → see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Equals_.28.3D.2C_.21.3D.29

Thanks, that’s exactly what I was looking for.