Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the city borders for a country

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?

like image 576
Gergo Boros Avatar asked Jan 24 '13 10:01

Gergo Boros


People also ask

How do I find a city border?

If you search Google Maps for a city and they have the city boundary, the boundary will be shown.

How do I get city boundaries on Google Maps?

To see it yourself, go to Google Maps and search for a city name or even a zip code. You will see a pinkish highlight around the border. Based on your zoom level, as you zoom out, Google will highlight the whole area, not just the borders, in the pink color.

How are city borders defined?

This metropolitan area is often defined by electoral boundaries, government statistics or legislation. Sometimes can be set by geography (i.e. mountain or river boundaries) or urban mobility systems. In many cases this may be the same as 'catchment area' U.N. or ELCA definition.

How did countries get their borders?

Political borders can be established through warfare, colonization, or mutual agreements between the political entities that reside in those areas; the creation of these agreements is called boundary delimitation.


1 Answers

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.
like image 116
Gergo Boros Avatar answered Sep 25 '22 23:09

Gergo Boros