Skip to content

Instantly share code, notes, and snippets.

@AlexandraKapp
Created August 2, 2019 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexandraKapp/8230de8a44766e6768001eb4b4c13b2e to your computer and use it in GitHub Desktop.
Save AlexandraKapp/8230de8a44766e6768001eb4b4c13b2e to your computer and use it in GitHub Desktop.

How to setup a geocoder api on your local computer

  1. Setup docker on your local machine and install Docker desktop
  2. Clone the nominitim-docker v3.0.0 repo:
git clone https://github.com/mediagis/nominatim-docker/tree/master/3.0

​ 3. Modify the Dockerfile and set your url to PBF

 PBF_DATA=https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf

​ 4. Set url for incremental update inside local.php

  @define('CONST_Replication_Url', 'http://download.geofabrik.de/europe/germany-updates');

​ 5. Build database

  docker build -t nominatim .

​ 6. Run docker container

docker run --restart=always -d -p 8080:8080 --name nominatim-berlin nominatim

​ If this succeeds, open http://localhost:8080/ in a web browser ​ 7. Example request to nominatim geocoder

http://localhost:8080/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1

​ Detailed information about the nominatim API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment