打开街道地图 - 按城市划分的街道
我正在开发一个基于 OSM(开放街道地图)数据收集的系统。
当我(从 OSM 数据库)获取覆盖许多城市的区域时,我有什么方法可以找出哪条街道(从庞大的 xml 列表中)属于哪个城市?尝试使用 OSM 服务器端脚本,但没有找到我对该手册的兴趣点。
看起来我可以获取属于该路径的任何(地址)节点并解析它以从中获取街道名称和城市名称。
但真正的问题是,有一些街道没有地址节点。所以看起来我有一大堆街道、城市,但无法确定哪些街道属于哪些城市?
我很乐意阅读任何有帮助的答案。
I am working on a system based on data collecting from OSM (Open Street Map).
When I fetch (from OSM database) an area that covers MANY cities, then have I got any way to figure out which street (from the vast xml list) belong to which city? Was trying to use OSM Server Side Script but didn't find my point of interest in that's manual.
Looks like I could take any (address) node that belongs to the way and parse it to get the street name and city name from it.
But the real problem is that there are some streets with no address nodes with. So it looks like I have a vast set of streets, cities, but no way how to decide which streets belongs to which cities?
I would be happy to read any answer that would be helpfull.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用overpass api下载整个城市。您应该首先找到定义城市的关系的 id(如果您的系统中还没有它,您可以通过 overpass api 查询它)。例如Vuppertal有62478。然后在id中添加3600000000并发送以下POST请求到http://www。 overpass-api.de:
您还可以使用 theis api 检查各个点所属的位置,仅下载城市中的街道,了解更多信息参见
更新: 要查找城市关系,请将以下 POST 请求发送至http://overpass-api.de/api/interpreter:
如果你想更加严格您可以如果您只查看 Germanz 或 admin_level= 等内容,请添加更多过滤器,例如 de:place=city 等。如果您想获得更多结果,您只能使用名称:
这取决于您,您认为“城市”是什么? ”。
You can use overpass api to download the whole city. You should first find id of the relation which defines the city (you can query for it via overpass api if you do not have it in your system already). For example Vuppertal has 62478. Then add 3600000000 to the id and send and send the following POST request to http://www.overpass-api.de:
You can also check where the individual points belongs of download only streets from the city using theis api, for more information see
Update: To find the city relation send the following POST request to http://overpass-api.de/api/interpreter:
if you want to be more restrictive you may add more filters like de:place=city if you are only looking at Germanz or admin_level= something etc. If you want to get more results, you can only use the name:
it is up to you, what do you consider "a city".