From f3ec2c0df0a57fca7350ac1c6dace60efe95fcbe Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 3 Jul 2023 18:34:24 +0200 Subject: [PATCH] OAM: adapt dbname, contour and hillshade paths --- docker-compose.yml | 2 +- run.sh | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 08012da..572784a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: - ./tiles:/data/tiles/ - ./oam/renderd.conf:/etc/renderd.conf - ./run.sh:/run.sh # for dev - #- ./pbf/belgium-latest.osm.pbf:/data/region.osm.pbf # change here your pbf + - ./pbf/luxembourg-latest.osm.pbf:/data/region.osm.pbf # change here your pbf - ./pbf/luxembourg.poly:/data/region.poly # and your poly - ./pbf/shp/:/data/shp/ - ./pbf/hillshade.tif:/data/hillshade.tif diff --git a/run.sh b/run.sh index 4f4eec2..89ab9d3 100755 --- a/run.sh +++ b/run.sh @@ -19,22 +19,16 @@ function compileStyle() { # mkdir /data/style/symbols/ # mv /data/style/cyclosm-cartocss-style/symbols/* /data/style/symbols/ # change dbname - # sed -i 's/dbname: "osm"/dbname: "gis"/g' ./cyclosm-cartocss-style/project.mml + sed -i 's/"dbname": "osmpg_db",/"dbname": "gis",/g' ./OpenArdenneMap/osm2pgsql/project.mml # # remove some deprecated fonts # sed -i 's/, "unifont Medium", "Unifont Upper Medium"//g' ./cyclosm-cartocss-style/fonts.mss # sed -i 's/"Noto Sans Tibetan Regular",//g' ./cyclosm-cartocss-style/fonts.mss # sed -i 's/"Noto Sans Tibetan Bold",//g' ./cyclosm-cartocss-style/fonts.mss # sed -i 's/Noto Sans Syriac Eastern Regular/Noto Sans Syriac Regular/g' ./cyclosm-cartocss-style/fonts.mss - # # change hillshade - # sed -i 's/*extents84/*extents/g' ./cyclosm-cartocss-style/project.mml - # sed -i 's,dem/shade.vrt,/data/hillshade.tif,g' ./cyclosm-cartocss-style/project.mml - # sed -z 's/status: off\n- id: contours100/status: on\n- id: contours100/' -i ./cyclosm-cartocss-style/project.mml - # # change contours - # sed -z 's/status: off\n- id: contours50/status: on\n- id: contours50/' -i ./cyclosm-cartocss-style/project.mml - # sed -z 's/status: off\n- id: contours20/status: on\n- id: contours20/' -i ./cyclosm-cartocss-style/project.mml - # sed -z 's/status: off\n- id: contours10/status: on\n- id: contours10/' -i ./cyclosm-cartocss-style/project.mml - # sed -z 's/status: off\n- id: waterway_low/status: on\n- id: waterway_low/' -i ./cyclosm-cartocss-style/project.mml - # sed -i 's/dbname: "contours"/dbname: "gis"/g' ./cyclosm-cartocss-style/project.mml + # change hillshade + sed -i 's,/mnt/tera/ChampsLibres/Projets/OSM/CyclOSM/hillshade/data/dem_be_10x10_hillshade_semi_transparent_3857.tif,/data/hillshade.tif,g' ./OpenArdenneMap/osm2pgsql/project.mml + # change contours + sed -i 's,/../contour/beautiful_contour_belgium.shp,/data/shp/contours.shp,g' ./OpenArdenneMap/osm2pgsql/project.mml # carto build carto OpenArdenneMap/osm2pgsql/project.mml > mapnik.xml } @@ -138,10 +132,6 @@ if [ "$1" == "import" ]; then sudo -u postgres psql -d gis -f /data/style/${NAME_SQL:-indexes.sql} fi - # Import contour files - shp2pgsql -s 31370:3857 -c -g geometry -I /data/shp/contours.shp public.contours | sudo -u renderer psql -d gis - sudo -u renderer psql -d gis -c "ALTER TABLE public.contours RENAME COLUMN elev TO height;" - # Register that data has changed for mod_tile caching purposes sudo -u renderer touch /data/database/planet-import-complete