Public | Automated Build

Last pushed: a year ago
Short Description
Automatic loader for .pbf file in OSM composition
Full Description

docker-osm2pgsql

A Docker image with osm2pgsql, the tool for importing OpenStreetMap data into a Postgresql database. Intended to be used with openfirmware/docker-postgres-osm.

Build Instructions

Can be built from the Dockerfile:

# docker build -t chatelao/docker-osm2pgsql github.com/chatelao/docker-osm2pgsql.git

This currently builds osm2pgsql for Debian from a specific tag; see the Dockerfile for the specific version. Alternatively, specify the tag and download the image from the Docker Hub.

Running osm2pgsql

Once the image is built, you can run a single-use container with osm2pgsql. Args will be passed to bash, so you will have access to environment variables in your run command.

# docker run -i -t --rm chatelao/docker-osm2pgsql -c 'osm2pgsql -h'

When used with a postgres-osm container, it can import data directly into the database:

# docker run -i -t --rm --link vagrant_postgres-osm_1:pg --network vagrant_default -v /vagrant/osm_mapdata:/osm chatelao/docker-osm2pgsql -c 'osm2pgsql --create --slim --cache 2000 --database $PG_ENV_OSM_DB --username $PG_ENV_OSM_USER --host pg --port $PG_PORT_5432_TCP_PORT /osm/monaco.osm.pbf'

# docker run -i -t --rm --link vagrant_postgres-osm_1:pg --network vagrant_default -v /vagrant/osm_mapdata:/osm chatelao/docker-osm2pgsql -c 'osm2pgsql --create --slim --cache 2000 --database gis --username osm --host pg --port 5432 /osm/monaco-latest.osm.pbf'

# docker run -i -t --rm --link vagrant_postgres-osm_1:pg --network vagrant_default -v /vagrant/osm_mapdata:/osm chatelao/docker-osm2pgsql -c 'osm2pgsql --create --slim --cache 2000 --database gis --username osm --host pg --port 5432 --number-processes 3 /osm/switzerland-latest.osm.pbf'    

For more information on running an import, please see TUTORIAL.markdown. If you have a particular scenario in mind, contact me and I will try to create a guide for that situation.

Todo

About

This Dockerfile was built with information from the Ubuntu 14.04 Switch2OSM guide.

Related Docker Images

Docker Pull Command
Owner
chatelao
Source Repository