OAM: change repo for style and adapt paths for OAM

This commit is contained in:
nobohan 2023-07-03 17:57:06 +02:00
parent a62a10552b
commit 17edd862a7
5 changed files with 30 additions and 42 deletions

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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

50
run.sh
View File

@ -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