I'm failing to get a union of node/way/relation using the area filter. It's returning only the first types (ie node). How do I return all? http://overpass-api.de/api/interpreter?data=[out:xml];area[name='London'];(node'fhrs:id';way'fhrs:id';relation'fhrs:id';);out body;>;out skel qt;" asked 09 Feb '17, 20:19 DaveF |
The help site seems to have mangled your url. Maybe the Overpass Turbo wizard does what you want? http://overpass-turbo.eu/s/mC7 That's the result of Turbo has a special operator to lookup places in Nominatim, but the area syntax works too: http://overpass-turbo.eu/s/mC8 If your url is mostly intact, the main issue is likely that the area filter has to be applied to each query as in the above links. If you need the data outside Turbo, the "Export" button provides a range of options. answered 09 Feb '17, 23:41 maxerickson Thanks for the reply. Turbo was my starting point, but I want to automate the download process via a windows batch file. The Overpass help is quite confusing, but it appears that overpass.api doesn't accept (area.searchArea). It also seems to not like quote marks (") but I haven't worked out why. When exported as overpassQL your Turbo routine returns the error: 'Invalid IPv6 numeric address.' (As did my attempts).
(10 Feb '17, 00:17)
DaveF
The named areas are a feature of Overpass API. The
(10 Feb '17, 00:57)
maxerickson
Thanks. Got there in the end with your last example. Apologies for my first post's copy/paste but this forum won't format it properly. Trying to post this api call;out center;) (<Markdown won't create link or code element! it gets confused by the brackets) Which I'd extrapolated from This OSM Help Question As I said I only get the first item (nodes) returned. Is it possible to get it to work, or is your solution the only way?
(10 Feb '17, 14:09)
DaveF
Yes, it is necessary to either use the named area or to repeat the area statement for each query. The node(area) query overwrites the input set, so the way(area) query looks for areas in the result of the node query, and of course there are none. It's possible to explicitly include the area in each query rather than doing it before the query: node(area:3600065606),way(area(3600065606) etc. I find the method using a named set clearer. The docs have more about it: http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_area_.28area.29
(10 Feb '17, 14:44)
maxerickson
|