forked from schaermu/vagrant-osm-tileserver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
34 lines (31 loc) · 1.79 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
test_db:
createdb -E UTF8 -O "${PG_USER}" "${PG_DB}"
psql -d "${PG_DB}" -c "CREATE EXTENSION postgis;"
psql -d "${PG_DB}" -c "CREATE EXTENSION hstore;"
echo "ALTER USER "${PG_USER}" WITH PASSWORD '${PG_PASSWORD}';" | psql -d "${PG_DB}"
ingest:
docker build --file Dockerfile.osm2pgsql --build-arg PBF_URL="${PBF_URL}" -t osm2pgsql .
docker run --net=host -it --rm osm2pgsql -c "PGPASSWORD=\"${PG_PASSWORD}\" osm2pgsql --hstore \
--database \"${PG_DB}\" \
--host \"${PG_HOST}\" \
--port \"${PG_PORT}\" \
--username \"${PG_USER}\" \
--cache \"${CACHE}\" \
--number-processes \"${NUM_PROCESSES}\" \
--style /default.style \
pbf/planet.osm.pbf && \
psql -d \"${PG_DB}\" -h \"${PG_HOST}\" -U \"${PG_USER}\" -p \"${PG_PORT}\" \
-c 'update planet_osm_line set name=\"name:en\" where \"name:en\" is not null and name!=\"name:en\"; \
update planet_osm_point set name=\"name:en\" where \"name:en\" is not null and name!=\"name:en\"; \
update planet_osm_polygon set name=\"name:en\" where \"name:en\" is not null and name!=\"name:en\"; \
update planet_osm_roads set name=\"name:en\" where \"name:en\" is not null and name!=\"name:en\";'"
serve:
sed -i "/\"host\"/c\config[\"postgis\"][\"host\"]=\"${PG_HOST}\"" data/config/osm-bright/configure.py
sed -i "/\"port\"/c\config[\"postgis\"][\"port\"]=\"${PG_PORT}\"" data/config/osm-bright/configure.py
sed -i "/\"dbname\"/c\config[\"postgis\"][\"dbname\"]=\"${PG_DB}\"" data/config/osm-bright/configure.py
sed -i "/\"user\"/c\config[\"postgis\"][\"user\"]=\"${PG_USER}\"" data/config/osm-bright/configure.py
sed -i "/\"password\"/c\config[\"postgis\"][\"password\"]=\"${PG_PASSWORD}\"" data/config/osm-bright/configure.py
docker-compose build
docker-compose up
cache-tiles:
docker-compose exec renderd render_list -a -z 0 -Z 10 -f -n "${NUM_PROCESSES}"