Skip to content

Commit

Permalink
Stream conversion to o5m
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed May 31, 2024
1 parent c7d53fd commit 0a9dc55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
cmd: run
```
Specify a PBF file for the region that you want to render and its corresponding polygon as `DOWNLOAD_PBF` and `DOWNLOAD_POLY`. Alternatively, mount them as `/data/region.osm.pbf` and `/data/region.poly`.
Specify a PBF file for the region that you want to render and its corresponding polygon as `DOWNLOAD_PBF` and `DOWNLOAD_POLY`. Alternatively, mount one [converted to O5M](https://wiki.openstreetmap.org/wiki/Osmconvert) as `/data/region.o5m` and `/data/region.poly`. Get a specific region from [Geofabrik](https://download.geofabrik.de/) or the whole planet from [Planet.osm](https://wiki.openstreetmap.org/wiki/Planet.osm) (in that case, `DOWNLOAD_POLY` can be omitted).

The docker container will expose a webserver under port `80` and the Postgres server (with PostGIS) on port `5432`.

Expand Down
5 changes: 2 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if [ "$1" == "import" ]; then

if [ -n "${DOWNLOAD_PBF:-}" ]; then
echo "INFO: Download PBF file: $DOWNLOAD_PBF"
wget ${WGET_ARGS:-} "$DOWNLOAD_PBF" -O /data/region.osm.pbf
wget ${WGET_ARGS:-} "$DOWNLOAD_PBF" -O- | osmconvert - -o=/data/region.o5m
if [ -n "${DOWNLOAD_POLY:-}" ]; then
echo "INFO: Download PBF-POLY file: $DOWNLOAD_POLY"
wget ${WGET_ARGS:-} "$DOWNLOAD_POLY" -O /data/region.poly
Expand All @@ -95,8 +95,7 @@ if [ "$1" == "import" ]; then
OSM2PGSQL_EXTRA_ARGS="${OSM2PGSQL_EXTRA_ARGS:-} --flat-nodes /data/database/flat_nodes.bin"
fi

osmconvert /data/region.osm.pbf -o=/data/database/a.o5m
osmfilter /data/database/a.o5m --parameter-file=/home/renderer/src/openptmap/toolchain_pt.filter -o=/data/database/gis.o5m
osmfilter /data/region.o5m --parameter-file=/home/renderer/src/openptmap/toolchain_pt.filter -o=/data/database/gis.o5m
chown renderer:renderer /data/database/gis.o5m

# Import data
Expand Down

0 comments on commit 0a9dc55

Please sign in to comment.