How can I extract the polygon coordinates of cities,towns and villages from OpenStreetMap?

Are there any other free databases available?


To extract selective data from OSM you can use Overpass, you could also check download server of Geofabrik

EDIT after some comments:

In OSM boundaries of cities and villages are tagged with boundary=administrative + admin_level=*, unfortunately in different countries there are different values of tag admin_level. Here is table with meaning of this values in different countries.

If you'll know admin_level you want you can go to overpass and write it in wizard, so overpass will give you your data. After it you can export it to few formats via Export button

Here is some query that will return city boundaries in south of poland

  • This does not answer my question! Aug 12 '14 at 16:34
  • 3
    Which question, cause you asked 2? :), you need all of them of only specified country? you need polygons or points? what format and srid? Answer was as good as good was the question...
    – Jendrusk
    Aug 12 '14 at 16:57
  • I am developing a web based software displaying data from gps devices mounted on trucks and i need to do report and display how much kilometeres were urban and suburban. So i need to have polygons with all the citys, towns and villages (for example in EUROPE ) Aug 12 '14 at 17:07
  • 2
    This could be difficult cause not everywhere exists such data, and if exists it could have different tagging. I'll try to write some tips
    – Jendrusk
    Aug 12 '14 at 17:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.