当前位置: 动力学知识库 > 问答 > 编程问答 >

openstreetmap - How to get the City and Country of an OSM node or way?

问题描述:

I am parsing country extracts of OSM data. What I want to is the get the name of the City and Country that that point or way belongs to. Is this possible? How can I go about getting this information?

网友答案:

To retrieve this information you need a geocoder, unless the node has the relevant address tags. Nominatim is a good geocoder for OSM and there are some more.

If you have the ID of the node or way, then just use Nominatim's reverse geocoding capabilities. This is the result for way 206488036: http://nominatim.openstreetmap.org/reverse?format=xml&osm_type=W&osm_id=206488036

Change the osm_type parameter if you want to query for nodes (N) or relations (R) instead of ways.

分享给朋友:
您可能感兴趣的文章:
随机阅读: