How can I get the city borders for a country

守給你的承諾、 提交于 2019-11-29 14:19:11

问题


I want to extract city specific data from OSM for Finland. I have the data for Finland but I need the data for only 5 cities: Helsinki, Espoo, Vantaa, Kauniainen and Siuntio. I could extract the required data for Helsinki, but I need the city borders for the rest of the cities (so I can make a polygon of that). If I have the polygons I can extract the required data with osmconvert

Can you help me with information on how to extract the borders for these cities?

Do you know any open api that provides me these information?


回答1:


Thanks to Roland Olbricht I've managed to resolve my problem. You can find information related to this question on this site. The solution is the following:

  1. generate the boundary with overpass api http://overpass-api.de/api/interpreter?data=(rel[name='Helsinki'];>;);out;
  2. you can change optionally 'Helsinki' to the city's name for which you want to generate the boundary
  3. after you downloaded the data you can convert it to a polygon with this script. You can find information on how to use the script in it's upper section.
  4. if you want to visualize the downloaded boundary, rename the interpreter file's extension to .osm and use QGIS (Quantum GIS) to display the borders. To load the osm file's data you'll need to install and activate the OpenStreetMap Plugin for QGIS. To install the plugin open QGIS and select Plugins>Fetch Python Plugins from the menu. On the plugins tab search for "openStreetMap plugin" and then hit install. You can activate the plugin by selecting Plugins > Manage plugins and by checking the check box for OpenStreetMap plugin.


来源:https://stackoverflow.com/questions/14499511/how-can-i-get-the-city-borders-for-a-country

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!