change paths and files for osmbe map style

This commit is contained in:
nobohan 2024-02-09 18:46:05 +01:00
parent a161cae48d
commit d49c6be309
4 changed files with 9 additions and 35 deletions

View File

@ -20,19 +20,6 @@ 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
``` ```
#### OAM data dependencies
##### Contour lines
Download the geopackage from http://opendata.champs-libres.be/beautiful-contour-belgium.zip, convert it to shp and place it into the pbf/shp folder under the name "contours.shp". It will be mounted as written in the `docker-compose.yml` file.
The shp is imported using `shp2pgsql` in the import step, assuming EPSG:31370 as the input shp CRS.
#### Hillshade
Download the hillshade at http://opendata.champs-libres.be/hillshade_belgium_EPSG3857.zip and place the tif file in the pdf folder, as mounted in the `docker-compose.yml` file.
#### Do an import #### Do an import
Download a pbf and a poly file of your choice on https://download.geofabrik.de and put it in the `pbf` folder. Change the lines of the pbf and poly paths in the volumes in the `docker-compose.yml` file Download a pbf and a poly file of your choice on https://download.geofabrik.de and put it in the `pbf` folder. Change the lines of the pbf and poly paths in the volumes in the `docker-compose.yml` file

View File

@ -7,7 +7,7 @@ services:
#- osm-data:/data/database/ #- osm-data:/data/database/
- ./database:/data/database/ - ./database:/data/database/
- ./tiles:/data/tiles/ - ./tiles:/data/tiles/
- ./oam/renderd.conf:/etc/renderd.conf - ./osmbe/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/luxembourg-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

View File

@ -12,7 +12,7 @@ font_dir=/usr/share/fonts
font_dir_recurse=true font_dir_recurse=true
; ADD YOUR LAYERS: ; ADD YOUR LAYERS:
[oam] [osmbe]
URI=/tile/ URI=/tile/
TILEDIR=/var/cache/renderd/tiles TILEDIR=/var/cache/renderd/tiles
XML=/data/style/mapnik.xml XML=/data/style/mapnik.xml

27
run.sh
View File

@ -14,20 +14,10 @@ function setPostgresPassword() {
function compileStyle() { function compileStyle() {
cd /data/style/ cd /data/style/
git clone --single-branch --branch osm-tile-server https://github.com/nobohan/OpenArdenneMap.git --depth 1 git clone --single-branch --branch master https://github.com/osmbe/openstreetmap-carto-be/--depth 1
# mv symbols folder # TODO check if changes are needed as in cyclosm and oam
mkdir /data/img/ # carto build TODO check paths
mv /data/style/OpenArdenneMap/img/* /data/img/ carto project.mml > mapnik.xml
# copy fonts
cp /data/style/OpenArdenneMap/fonts/* /usr/share/fonts/
# change dbname
sed -i 's/"dbname": "osmpg_db",/"dbname": "gis",/g' ./OpenArdenneMap/osm2pgsql/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_3857.shp,g' ./OpenArdenneMap/osm2pgsql/project.mml
# carto build
carto OpenArdenneMap/osm2pgsql/project.mml > mapnik.xml
} }
@ -71,7 +61,6 @@ if [ "$1" == "import" ]; then
sudo -u postgres createdb -E UTF8 -O renderer gis sudo -u postgres createdb -E UTF8 -O renderer gis
sudo -u postgres psql -d gis -c "CREATE EXTENSION postgis;" sudo -u postgres psql -d gis -c "CREATE EXTENSION postgis;"
sudo -u postgres psql -d gis -c "CREATE EXTENSION hstore;" sudo -u postgres psql -d gis -c "CREATE EXTENSION hstore;"
sudo -u postgres psql -d gis -c "CREATE EXTENSION postgis_sfcgal;"
sudo -u postgres psql -d gis -c "ALTER TABLE geometry_columns OWNER TO renderer;" sudo -u postgres psql -d gis -c "ALTER TABLE geometry_columns OWNER TO renderer;"
sudo -u postgres psql -d gis -c "ALTER TABLE spatial_ref_sys OWNER TO renderer;" sudo -u postgres psql -d gis -c "ALTER TABLE spatial_ref_sys OWNER TO renderer;"
setPostgresPassword setPostgresPassword
@ -111,8 +100,8 @@ if [ "$1" == "import" ]; then
OSM2PGSQL_EXTRA_ARGS="${OSM2PGSQL_EXTRA_ARGS:-} --flat-nodes /data/database/flat_nodes.bin" OSM2PGSQL_EXTRA_ARGS="${OSM2PGSQL_EXTRA_ARGS:-} --flat-nodes /data/database/flat_nodes.bin"
fi fi
# Import data # Import data TODO check the path and other options
sudo -u renderer osm2pgsql -d gis --create --slim -G -S /data/style/OpenArdenneMap/osm2pgsql/OpenArdenneMap.style --extra-attributes \ sudo -u renderer osm2pgsql -d gis --create --slim -G -S /openstreetmap-carto.style --extra-attributes \
/data/region.osm.pbf \ /data/region.osm.pbf \
${OSM2PGSQL_EXTRA_ARGS:-} \ ${OSM2PGSQL_EXTRA_ARGS:-} \
; ;
@ -128,8 +117,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
sudo -u postgres psql -d gis -f /data/style/OpenArdenneMap/create_views.sql
# Register that data has changed for mod_tile caching purposes # Register that data has changed for mod_tile caching purposes
sudo -u renderer touch /data/database/planet-import-complete sudo -u renderer touch /data/database/planet-import-complete
@ -215,7 +202,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/oam/tiles.list | render_list --map oam cat /data/tiles/osmbe/tiles.list | render_list --map osmbe
bash bash
fi fi