我如何获得一个国家的城市边界 [英] How can I get the city borders for a country

查看:158
本文介绍了我如何获得一个国家的城市边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从OSM中提取针对芬兰的城市特定数据.我有芬兰的数据,但我只需要5个城市的数据:赫尔辛基,埃斯波,万塔,考尼艾宁和西恩蒂奥.我可以提取赫尔辛基所需的数据,但是我需要其余城市的城市边界(因此我可以创建一个多边形).如果我有多边形,则可以使用 osmconvert

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?

您知道有向我提供这些信息的开放式api吗?

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

推荐答案

感谢 Roland Olbricht 我已经设法解决了我的问题.您可以在本网站上找到与该问题有关的信息.解决方法如下:

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. 使用立交桥api
  2. 下载数据后,可以使用此脚本将其转换为多边形.您可以在上半部分找到有关如何使用脚本的信息.
  3. 如果要可视化下载的边界,请将解释器文件的扩展名重命名为.osm,然后使用 QGIS( Quantum GIS)以显示边界.要加载osm文件的数据,您需要安装并激活用于QGIS的OpenStreetMap插件.要安装插件,请打开QGIS,然后从菜单中选择插件">获取Python插件".在插件"选项卡上搜索"openStreetMap插件",然后单击安装".您可以通过选择插件">管理插件"并选中"OpenStreetMap插件"复选框来激活插件.
  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.

这篇关于我如何获得一个国家的城市边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆