This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

xapi query don’t return the associated node => where is my mistake

1

Hi,

I have sent this query to get relations. The server response give me the relations but not the nodes used in this relation.

My query is : http://overpass.osm.rambler.ru/cgi/xapi?relation[type=enforcement][bbox=-5.9,42.3,9,51]

I want with the relations, the node associated with this relations, not all the node !

what can I add to my query as to have the nodes description ? Where is my mistake ?

Best Regards Michel

asked 12 May '12, 08:16

michel60's gravatar image

michel60
46334
accept rate: 0%

It's not really clear what you want, maybe you can ask the question in your own language.

I believe the response I got from that was relevant to the query. (All relations within bbox of type enforcement). I got the nodes related to the relations.

(12 May '12, 09:18) TheOddOne2

One Answer:

2

To get the relations only, the query

http://overpass.osm.rambler.ru/cgi/xapi?relation[type=enforcement][bbox=-5.9,42.3,9,51]

is fine. If you want something else, you should use Overpass QL to formulate what you want exactly.

Relations only (again):

http://overpass.osm.rambler.ru/cgi/interpreter?data=rel[type=enforcement](42.3,-5.9,51,9);out;

Relations and only nodes that are members:

http://overpass.osm.rambler.ru/cgi/interpreter?data=(rel[type=enforcement](42.3,-5.9,51,9);node(r););out;

Relations and the node and way members and the nodes belonging to the way members

http://overpass.osm.rambler.ru/cgi/interpreter?data=(rel[type=enforcement](42.3,-5.9,51,9);>;);out;

Or if you want to process the data with JOSM or Osmosis, you need meta data. Replace out; by out meta;

http://overpass.osm.rambler.ru/cgi/interpreter?data=(rel[type=enforcement](42.3,-5.9,51,9);>;);out meta;

In case your browser has difficulties with spaces in URL:

http://overpass.osm.rambler.ru/cgi/interpreter?data=(rel[type=enforcement](42.3,-5.9,51,9);>;);out+meta;

Caution: these queries may take some minutes.

answered 12 May '12, 11:46

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

Source code available on GitHub .