Sign inSign up

rhessing/import-osm

By rhessing

•Updated over 6 years ago

Forked from: openmaptiles/import-osm. Improvements made, using imposm3 v0.10

Image
0

829

rhessing/import-osm repository overview

⁠Import OSM into PostGIS using imposm3

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

⁠Improvements over openmaptiles build

  • imposm3 v0.10.0
  • added -optimize flag
  • Automatic cache detection, preventing overwrite of previous data when importing multiple PBF files or wanting to add new data later on

Todo: add automated update functionality

⁠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 PGHOST="127.0.0.1" \
    -e PGDATABASE="openmaptiles" \
    -e PGUSER="openmaptiles" \
    -e PGPASSWORD="openmaptiles" \
    openmaptiles/import-osm

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

To customize the zoom level used to expire tiles, use the environnement variable EXPIRETILES_ZOOM (default to 14). See the imposm documentation on tiles expiration⁠.

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

Tag summary

Content type

Image

Digest

Size

425.2 MB

Last updated

over 6 years ago

docker pull rhessing/import-osm