Skip to content

Instantly share code, notes, and snippets.

@fdnklg
Created July 30, 2019 12:30
Show Gist options
  • Save fdnklg/a4c9689b4f5a0251451f1eeef6bd409b to your computer and use it in GitHub Desktop.
Save fdnklg/a4c9689b4f5a0251451f1eeef6bd409b 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
  1. Modify the Dockerfile and set your url to PBF
 PBF_DATA=https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
  1. Set url for incremental update inside local.php
  @define('CONST_Replication_Url', 'http://download.geofabrik.de/europe/germany-updates');
  1. Build database
  docker build -t nominatim .
  1. 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

  1. 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