OSM API如何按城市获取所有郊区?
有人可以告诉我如何在 OpenStreetMap API 中按城市(名称、ID 等)获取郊区列表吗?我找不到任何详细的文档,而且 API 非常抽象。
我正在研究扩展 API,Xapi。我发现如何获得点头并仅过滤郊区,但我不知道如何设置城市值。
http://www.informationfreeway.org/api/0.6/node[place=suburb]
欢迎任何其他方式或 API。查看了地理名称和谷歌地图,但没有找到我要找的东西。我需要萨格勒布/克罗地亚的所有郊区列表以及一种检查特定街道是否位于该郊区的方法。正如我所见,OSM 拥有相当不错且准确的数据,但我在使用此 API 时遇到了问题。
Can someone tell me how to get a list of suburbs by city (name,id,whatever) in OpenStreetMap API? I can't find 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过设置边界框,然后过滤结果以确保它们实际上位于萨格勒布内?
这是使用在 openstreetmap.org 上创建的边界框的 URL
http://open.mapquestapi.com/xapi/api/0.6/node[place=suburb][bbox=15.807,45.761,16.18,45.875]
这给了你名字,但由于我还是 OSM 新手,所以我'我不太确定您如何建立他们的管理级别以及他们是否实际上位于萨格勒布内或仅在该边界框中。可能会有进一步的请求来确定此信息。
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.
出于您的目的,我将使用 OSM 服务器端脚本
这里是文档
For your purposes I would use OSM Server Side Script
here is the documentation