Skip to content

Import OpenStreetMap into PostGIS using imposm3

License

Notifications You must be signed in to change notification settings

Sophox/import-osm

 
 

Repository files navigation

Import OSM into PostGIS using imposm3

Docker Automated build

Note This is an updated version of the unmaintained openmaptiles/import-osm. We will try to merge pull requests much quicker, and will continue pushing openmaptiles to merge contributions.

This Docker image will import an OSM PBF file using imposm3 and a custom mapping configuration.

Usage

Download PBF File

Use Geofabrik and choose the extract of your country or region. Download it and put it into the directory.

Import

The import-osm Docker container will take the first PBF file in the volume mounted to the /import folder and import it using imposm3 using the mapping file from the $MAPPING_YAML (default /mapping/mapping.yaml).

Volumes:

  • Mount your PBFs into the /import folder
  • Mount your mapping.yaml into the /mapping folder
  • If you want to use diff mode mount a persistent location to the /cache folder for later reuse
docker run --rm \
    -v $(pwd):/import \
    -v $(pwd):/mapping \
    -e PGUSER="osm" \
    -e PGPASSWORD="osm" \
    -e PGHOST="127.0.0.1" \
    -e PGDATABASE="osm" \
    openmaptiles/import-osm

Use standard Postgres environment variables to connect, such as PGHOST, PGDATABASE, PGUSER, PGPASSWORD, PGPORT. All are required except for PGPORT.

For backward compatibility the script also supports POSTGRES_HOST, POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_PORT, but they are not recommended.

Legacy version

An additional docker image with a -legacy tag will be published by hand. It contains custom openmaptiles/imposm v2017-10-18 version to stay compatible with legacy deployments.

About

Import OpenStreetMap into PostGIS using imposm3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 72.2%
  • Dockerfile 19.5%
  • Makefile 8.3%