From 17edd862a7855f1ee0275812f69f95201f7589d1 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 3 Jul 2023 17:57:06 +0200 Subject: [PATCH] OAM: change repo for style and adapt paths for OAM --- README.md | 12 +-------- apache.conf | 2 ++ docker-compose.yml | 6 ++--- {cyclosm => oam}/renderd.conf | 2 +- run.sh | 50 ++++++++++++++++------------------- 5 files changed, 30 insertions(+), 42 deletions(-) rename {cyclosm => oam}/renderd.conf (97%) diff --git a/README.md b/README.md index bce1fbf..eaa50cc 100644 --- a/README.md +++ b/README.md @@ -20,17 +20,7 @@ For entering into the container, use the "terminal" argument of the run.sh scrip docker-compose run --rm map terminal ``` -#### Cyclosm data dependencies - -##### Shp - -Download the 2 following zip files, unzip them, and place them in the `pbf/shp` folder. They are mounted as volume in the docker-compose.yml. - -- http://osmdata.openstreetmap.de/download/simplified-land-polygons-complete-3857.zip -- http://osmdata.openstreetmap.de/download/land-polygons-split-3857.zip - -Also, rename them as in the zip file, so simplified-land-polygons-complete-3857.shp and land-polygons-split-3857.shp. - +#### OAM data dependencies ##### Contour lines diff --git a/apache.conf b/apache.conf index 5d8855f..d8a91d4 100644 --- a/apache.conf +++ b/apache.conf @@ -9,6 +9,8 @@ DocumentRoot /var/www/html + ServerName 192.168.192.2 + ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined diff --git a/docker-compose.yml b/docker-compose.yml index 7b26a0c..08012da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,14 +7,14 @@ services: #- osm-data:/data/database/ - ./database:/data/database/ - ./tiles:/data/tiles/ - - ./cyclosm/renderd.conf:/etc/renderd.conf + - ./oam/renderd.conf:/etc/renderd.conf - ./run.sh:/run.sh # for dev - - ./pbf/luxembourg-latest.osm.pbf:/data/region.osm.pbf # change here your pbf + #- ./pbf/belgium-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 ports: - - "8080:80" + - "9000:80" command: "run" # volumes: diff --git a/cyclosm/renderd.conf b/oam/renderd.conf similarity index 97% rename from cyclosm/renderd.conf rename to oam/renderd.conf index 6c1b493..336e337 100644 --- a/cyclosm/renderd.conf +++ b/oam/renderd.conf @@ -12,7 +12,7 @@ font_dir=/usr/share/fonts font_dir_recurse=true ; ADD YOUR LAYERS: -[cyclosm] +[oam] URI=/tile/ TILEDIR=/var/cache/renderd/tiles XML=/data/style/mapnik.xml diff --git a/run.sh b/run.sh index d0185b9..4f4eec2 100755 --- a/run.sh +++ b/run.sh @@ -14,32 +14,29 @@ function setPostgresPassword() { function compileStyle() { cd /data/style/ - git clone --single-branch --branch v0.6 https://github.com/cyclosm/cyclosm-cartocss-style.git --depth 1 + git clone --single-branch --branch master https://github.com/nobohan/OpenArdenneMap.git --depth 1 # mv symbols folder - mkdir /data/style/symbols/ - mv /data/style/cyclosm-cartocss-style/symbols/* /data/style/symbols/ - # change shp paths - sed -i "s,file: http://osmdata.openstreetmap.de/download,file: /data/shp,g" ./cyclosm-cartocss-style/project.mml - sed -i "s/.zip/.shp/g" ./cyclosm-cartocss-style/project.mml + # 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 - # 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 + # sed -i 's/dbname: "osm"/dbname: "gis"/g' ./cyclosm-cartocss-style/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 # carto build - carto cyclosm-cartocss-style/project.mml > mapnik.xml + carto OpenArdenneMap/osm2pgsql/project.mml > mapnik.xml } @@ -61,6 +58,8 @@ fi set -x if [ "$1" == "terminal" ]; then + + compileStyle bash fi @@ -139,9 +138,6 @@ if [ "$1" == "import" ]; then sudo -u postgres psql -d gis -f /data/style/${NAME_SQL:-indexes.sql} fi - # Create cyclosm special views - sudo -u renderer psql -d gis -f "/data/style/cyclosm-cartocss-style/views.sql" - # 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;" @@ -231,7 +227,7 @@ if [ "$1" == "generate_tiles" ]; then sudo -u renderer renderd -c /etc/renderd.conf - cat /data/tiles/cyclosm/tiles.list | render_list --map cyclosm + cat /data/tiles/oam/tiles.list | render_list --map oam bash fi