22 lines
605 B
Bash
Executable file
22 lines
605 B
Bash
Executable file
#!/bin/bash
|
|
# scripts/02_import_tiles.sh
|
|
# Import OSM data into PostGIS using osm2pgsql's default schema.
|
|
# Martin serves vector tiles directly from these tables.
|
|
|
|
set -euo pipefail
|
|
|
|
PBF_FILE="${PBF_FILE:-/data/osm/region.osm.pbf}"
|
|
PG_CONN="${PG_CONN:-postgres://maps:maps@postgres:5432/maps}"
|
|
|
|
echo "=== Importing tile data from $PBF_FILE ==="
|
|
|
|
osm2pgsql \
|
|
--create \
|
|
--slim \
|
|
--database "$PG_CONN" \
|
|
--hstore \
|
|
--number-processes 2 \
|
|
--cache 512 \
|
|
"$PBF_FILE"
|
|
|
|
echo "Tile data import complete. Tables: planet_osm_point, planet_osm_line, planet_osm_polygon, planet_osm_roads"
|