osm-bzh / osmbr-mapstyle

OSM Mapnik style for osm-bzh project.
GNU General Public License v3.0
1 stars 3 forks source link

English

This is the OSM Mapnik style for the osm-bzh project (www.openstreetmap.bzh). It is derived from the Lyrk mapstyle you can found at https://github.com/lyrk/lyrk-mapstyle.

This style has been created to set up tile map services for minorred langages in France :

French

Ceci est le style OSM Mapnik pour le projet osm-bzh (www.openstreetmap.bzh). Il est dérivé du style Lyrk que vous pouvez trouver ici : https://github.com/lyrk/lyrk-mapstyle.

Ce style a été créé afin de mettre en œuvre des services cartographiques de tuiles pour les langues minorées de France :

Preview

br_zoom_08

br_zoom_09

br_zoom_11

br_zoom_14_maez

br_zoom_14_urb

Set up

Create an unix user and clone this repository

Create a user 'osmbr' on your server.

Create directories and clone this repository :

mkdir /data
mkdir /data/dumps
mkdir /data/styles

cd /data/project/styles/
git clone https://github.com/osm-bzh/osmbr-mapstyle.git

# rename the directory
mv osmbr-mapstyle br

# move to the git clone repository
cd /data/project/styles/br/

Get low scales datas

We use 2 layers for low scales. They need to be in /data/project/styles/data/ :

cd /data/project/styles/data/

wget https://osmdata.openstreetmap.de/download/simplified-land-polygons-complete-3857.zip
unzip simplified-land-polygons-complete-3857.zip

wget https://osmdata.openstreetmap.de/download/land-polygons-split-3857.zip
unzip land-polygons-split-3857.zip

cd simplified-land-polygons-complete-3857
shapeindex *.shp

cd ../land-polygons-split-3857
shapeindex *.shp

The database

Data model

We use the classic planet_osm database an tables loaded by the famous osm2pgsql programm.

In your /etc/hosts file, add an entry for db.openstreetmap.world, with the IP of your PostgreSQL database server.

Create database and role

Create the database and the 'osmbr' role :

# osm user
psql -c "CREATE USER osmbr WITH LOGIN SUPERUSER PASSWORD 'm4d31nbr31zh';"

# the database
psql -c "CREATE DATABASE osm WITH OWNER = osmbr ENCODING = 'UTF8';"

# 2 classic extensions for OSM
psql -d osm -c "CREATE EXTENSION IF NOT EXISTS hstore;"
psql -d osm -c "CREATE EXTENSION IF NOT EXISTS postgis;"

Load datas

You need to install 2 packages :

So apt install osmctools osm2pgsql will do the job.

Then run /scripts/update_db.sh to load the database. It will :

See the map

You can set up a whole tile server (see here) or, easier and faster and for developement purposes, use Kosmtik.