开发者

OSM API how to get all suburbs by city?

开发者 https://www.devze.com 2023-02-12 05:56 出处:网络
Can someone tell me how to get a list of suburbs by city (name,id,whatever) in OpenStreetMap API? I can\'t fin开发者_开发百科d any detailed documentation and the API is pretty abstract.

Can someone tell me how to get a list of suburbs by city (name,id,whatever) in OpenStreetMap API? I can't fin开发者_开发百科d any detailed documentation and the API is pretty abstract.

I'm looking at extended API, Xapi. I found how I can get nods and filter only suburbs, but I don't know how to set the city value.

http://www.informationfreeway.org/api/0.6/node[place=suburb]

Any other way or API is welcomed. Looked at geonames and google maps, but haven't found what I'm looking for. I need a list of all suburbs in Zagreb/Croatia and a way to check if a specific street is in that suburb. OSM has a pretty good and accurate data as I can see, but I'm having troubles with this API.


Have you tried setting the bounding box and then filtering the results to ensure that they are actually within Zagreb?

Here's a URL using a bounding box created on openstreetmap.org http://open.mapquestapi.com/xapi/api/0.6/node[place=suburb][bbox=15.807,45.761,16.18,45.875]

This gives you names, but since I'm still new to OSM, I'm not quite sure how you establish their admin level and whether they actually lie within Zagreb or just within that bounding box. There may be further requests that could establish this info.


For your purposes I would use OSM Server Side Script

here is the documentation

0

精彩评论

暂无评论...
验证码 换一张
取 消