[OSM-dev] Syntax of XAPI queries with OR and NOT?

Paul Hartmann phaaurlt at googlemail.com
Sun Apr 15 19:40:23 BST 2012


2012/4/15 Stefan Keller <sfkeller at gmail.com>:
> Hi,
>
> With a XAPI API I'd like to make following query types (operators/predicates):
> 1) OR query: Example "[amenity=restaurant] OR [tourism=office]"
> 2. NOT query: Example "NOT [cuisine=pizza]"
>
> What could be a suitable syntax for doing this?
> My suggestions:
> 1a) ?xapi=node[amenity=restaurant]|[tourism=office]
> or 1b) ?xapi=node[amenity=restaurant]|node[tourism=office]
> 2) ?xapi=-node[cuisine=pizza]
>
> Or did I miss something in
> http://wiki.openstreetmap.org/wiki/XAPI#Tag_Predicates ?
>
> Yours, Stefan

Not sure, what you are up to, but you could use Overpass API, e.g.

1)

(node["name"="Lichtscheid"];node["name"="Müngstener Straße"]);out;

full URL: <http://overpass-api.de/api/interpreter?data=way%5B%22highway%22%21%3D%22residential%22%5D%2850%2E7%2C7%2E1%2C50%2E701%2C7%2E101%29%3Bout%3B>

2)

way["highway"!="residential"](50.7,7.1,50.701,7.101);out; [2]

full URL: <http://overpass-api.de/api/interpreter?data=way%5B%22highway%22%21%3D%22residential%22%5D%2850%2E7%2C7%2E1%2C50%2E701%2C7%2E101%29%3Bout%3B>

Paul



More information about the dev mailing list