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

Getting Way having k value equal to highway

0

I want to filter the osm data such that k value under <tag> equals to highway, right now i am downloading whole data using bbox(GET /api/0.6/map?bbox=left,bottom,right,top) API checking whether value of k equals to "highway" or not, Is there any short method such that i can fetch the data where k value equals to "highway" . Thanks in advance

asked 17 Aug '13, 11:25

Mawa's gravatar image

Mawa
1111
accept rate: 0%

edited 17 Aug '13, 11:26


One Answer:

3

It's much better to use Overpass for this type of query. It offloads a big bbox GET request from the API and you can filter by tags. See the wiki page for details, or use the xapi syntax as follows (example is for mapquest version, there are others, for instance on Overpass Turbo):

http://open.mapquestapi.com/xapi/api/0.6/way[highway=*][bbox=lon_low,lat_low,lon_hi,lat_hi]

answered 17 Aug '13, 13:35

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

1

Please note that the MapQuest XAPI endpoint is not associated to the Overpass API, and that MapQuest currently uses an outdated data base. For this reason I strongly recommend to use one of the other instances instead.

I, as maintainer of the Overpass XAPI instances, get from time to time bug reports that the MapQuest instance is out of date, but I cannot do more than anybody else on that problem.

(19 Aug '13, 06:47) Roland Olbricht

Source code available on GitHub .