Example for import OSM data with boundary filtering
Raw data can be exported directly from OpenStreetMap, or downloaded from Geofabrik Download Server
In this case, china-latest.osm.pbf is used.
Download osmosis
copy the content of source directory to your working directory
[your/working/directory/]
├─── china-latest.osm.pbf # latest open street map file of China
├─── osmosis-latest.tgz # osmosis binary package for import open street map data file
├─── hk.poly # poly file of Hong Kong SAR boundary
└─── Dockerfile # docker setup file
run following script to build images
docker build -t osm-regional-data .
create your container
docker run -d --name osmdb -e POSTGRES_PASSWORD=password -p 45432:5432 osm-regional-data
Now database is setup with Hong Kong data imported.
Connection information as following:
Hostname | Port | Password |
---|---|---|
localhost | 45432 | password |