OAM: change repo for style and adapt paths for OAM
This commit is contained in:
parent
a62a10552b
commit
17edd862a7
12
README.md
12
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
|
docker-compose run --rm map terminal
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Cyclosm data dependencies
|
#### OAM 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.
|
|
||||||
|
|
||||||
|
|
||||||
##### Contour lines
|
##### Contour lines
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
DocumentRoot /var/www/html
|
DocumentRoot /var/www/html
|
||||||
|
|
||||||
|
ServerName 192.168.192.2
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@ services:
|
|||||||
#- osm-data:/data/database/
|
#- osm-data:/data/database/
|
||||||
- ./database:/data/database/
|
- ./database:/data/database/
|
||||||
- ./tiles:/data/tiles/
|
- ./tiles:/data/tiles/
|
||||||
- ./cyclosm/renderd.conf:/etc/renderd.conf
|
- ./oam/renderd.conf:/etc/renderd.conf
|
||||||
- ./run.sh:/run.sh # for dev
|
- ./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/luxembourg.poly:/data/region.poly # and your poly
|
||||||
- ./pbf/shp/:/data/shp/
|
- ./pbf/shp/:/data/shp/
|
||||||
- ./pbf/hillshade.tif:/data/hillshade.tif
|
- ./pbf/hillshade.tif:/data/hillshade.tif
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "9000:80"
|
||||||
command: "run"
|
command: "run"
|
||||||
|
|
||||||
# volumes:
|
# volumes:
|
||||||
|
@ -12,7 +12,7 @@ font_dir=/usr/share/fonts
|
|||||||
font_dir_recurse=true
|
font_dir_recurse=true
|
||||||
|
|
||||||
; ADD YOUR LAYERS:
|
; ADD YOUR LAYERS:
|
||||||
[cyclosm]
|
[oam]
|
||||||
URI=/tile/
|
URI=/tile/
|
||||||
TILEDIR=/var/cache/renderd/tiles
|
TILEDIR=/var/cache/renderd/tiles
|
||||||
XML=/data/style/mapnik.xml
|
XML=/data/style/mapnik.xml
|
50
run.sh
50
run.sh
@ -14,32 +14,29 @@ function setPostgresPassword() {
|
|||||||
|
|
||||||
function compileStyle() {
|
function compileStyle() {
|
||||||
cd /data/style/
|
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
|
# mv symbols folder
|
||||||
mkdir /data/style/symbols/
|
# mkdir /data/style/symbols/
|
||||||
mv /data/style/cyclosm-cartocss-style/symbols/* /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
|
|
||||||
# change dbname
|
# change dbname
|
||||||
sed -i 's/dbname: "osm"/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
|
# # remove some deprecated fonts
|
||||||
sed -i 's/, "unifont Medium", "Unifont Upper Medium"//g' ./cyclosm-cartocss-style/fonts.mss
|
# 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 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 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
|
# sed -i 's/Noto Sans Syriac Eastern Regular/Noto Sans Syriac Regular/g' ./cyclosm-cartocss-style/fonts.mss
|
||||||
# change hillshade
|
# # change hillshade
|
||||||
sed -i 's/*extents84/*extents/g' ./cyclosm-cartocss-style/project.mml
|
# 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 -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
|
# sed -z 's/status: off\n- id: contours100/status: on\n- id: contours100/' -i ./cyclosm-cartocss-style/project.mml
|
||||||
# change contours
|
# # 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: 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: 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: 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 -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: "contours"/dbname: "gis"/g' ./cyclosm-cartocss-style/project.mml
|
||||||
# carto build
|
# carto build
|
||||||
carto cyclosm-cartocss-style/project.mml > mapnik.xml
|
carto OpenArdenneMap/osm2pgsql/project.mml > mapnik.xml
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -61,6 +58,8 @@ fi
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
if [ "$1" == "terminal" ]; then
|
if [ "$1" == "terminal" ]; then
|
||||||
|
|
||||||
|
compileStyle
|
||||||
bash
|
bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -139,9 +138,6 @@ if [ "$1" == "import" ]; then
|
|||||||
sudo -u postgres psql -d gis -f /data/style/${NAME_SQL:-indexes.sql}
|
sudo -u postgres psql -d gis -f /data/style/${NAME_SQL:-indexes.sql}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create cyclosm special views
|
|
||||||
sudo -u renderer psql -d gis -f "/data/style/cyclosm-cartocss-style/views.sql"
|
|
||||||
|
|
||||||
# Import contour files
|
# Import contour files
|
||||||
shp2pgsql -s 31370:3857 -c -g geometry -I /data/shp/contours.shp public.contours | sudo -u renderer psql -d gis
|
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;"
|
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
|
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
|
bash
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user