[Geocoding] Countries not loaded in Nominatim base installation?

Sarah Hoffmann lonvia at denofr.de
Wed Jun 4 19:21:27 UTC 2014


Hi,

On Wed, Jun 04, 2014 at 08:53:32AM -0400, Christian Béland wrote:
> I just installed the Nominatim geocoder and loaded the Andorra.pbf dataset.
> 
> I saw that in the Nominatim project, there are multiple .sql file in the
> data/ folder with country names and polygon that were injected in the
> database during the installation process.
> 
> Files:
>    - country_name.sql
>    - country_naturalearthdata.sql
>    - country_osm_grid.sql
>    - us_state.sql
>    - us_country.sql
> 
> I was assuming that with this base installation I would be able to query
> Nominatim with different country names and that it would provide me
> results... but it does not. No result found each time.
> 
> Did I miss a step in the installation process to be able to use the content
> of those file in the Nominatim query?

The preprocessed country data is used only to determine which country a
place is in and then search the place by this country. If you want to be
able to find the country itself, you actually need a place object for this
country.

> Is there a way to use retrieve this data in query?

You should get all country boundaries from Overpass with a query like this:

wget -O countries.osm 'http://overpass-api.de/api/interpreter?data=relation["boundary"="administrative"]["admin_level"="2"];(._;>;);out body;'

The resulting file is about 200MB. You can then either import it in a new DB 
with setup.php as usual. Or if you want to add the country boundaries to an
existing DB run:

./utils/update.php --import-file countries.osm --index

Sarah



More information about the Geocoding mailing list