2

I'm trying to query the OSM Overpass API to find any amenities within a bounding box. The actual query in my program will be generic but in my testing I noticed I cannot retrieve the coordinates(latitude, longitude) of any of the ways. Here is my script:

(
   node
      ["amenity"="police"]
      (39.235,-76.715,39.373,-76.525);
   way
      ["amenity"="police"]
      (39.235,-76.715,39.373,-76.525);
);
(._;>;);
out meta;

I need to use ways because I'm missing a significant amount of data without them. Unfortunately they do not include any coordinate data despite me adding out meta instead of the normal out. This was answered here, overpass-api ways query include coordinates about a year ago but that solution no longer works. Is this a bug? Or am I doing something wrong? I've also tried out center, out geom, and out skel to no success. I'm outputting the data in xml.

ANSWERED, I left on the recursion line on the end by accident. Thanks Tyr.

Community
  • 1
  • 1
Inhert
  • 29
  • 4
  • 1
    `out center` & co. should still work. Maybe you forgot to drop the recursion line when playing with these output modes? http://overpass-turbo.eu/s/aPw – tyr Aug 07 '15 at 18:00
  • 1
    I don't get it. The result of your query *does* include coordinates for the nodes. Just not inside ``, they are listed separately. For each `` with the corresponding ID and coordinates. – scai Aug 07 '15 at 20:42
  • Thanks tyr you were correct. Scai, each way has numerous node references that don't point to the way, but point to other nodes. They wouldn't give the coordinates of the way. – Inhert Aug 10 '15 at 12:51

0 Answers0