Pergunta

I have set my own OpenStreetMap server (database is PostGis) and I'm using Nominatim for geo-coding and conversions from address to coordinate or coordinates to addresses. I need to get a list of all place names (cities, towns, villages etc.) from a country, but I still have trouble with understanding the DB structure. Any ideas how to do that?

I know there are other solutions (GeoNames or other available databases), please understand that I do not want to use them and I need to do this just by using OSM database and/or Nominatim database.

Foi útil?

Solução

You need to download the OSM data you are interested in and load it to PostGIS using osm2pgsql. (not sure if you have already done this)

Then you just run the query:

  select name from planet_osm_point where place in ('city','town','village');

The data is not guaranteed to be complete off course, because the labelling is done in a crowd-sourced way.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top