User Tools

Site Tools


terra4d:osmserver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
terra4d:osmserver [2023/04/21 13:33]
editor created
terra4d:osmserver [2026/02/12 15:46] (current)
editor
Line 1: Line 1:
 ====== OpenStreetMap tile server ====== ====== OpenStreetMap tile server ======
 +
 +For a detailed instruction please check her: [[https://switch2osm.org/serving-tiles/using-a-docker-container/]]
  
 ===== Installation ===== ===== Installation =====
Line 6: Line 8:
      * [[https://docs.docker.com/engine/install/ubuntu/|Ubuntu]]      * [[https://docs.docker.com/engine/install/ubuntu/|Ubuntu]]
      * [[https://docs.docker.com/engine/install/debian/|Debian]]      * [[https://docs.docker.com/engine/install/debian/|Debian]]
-  * Download the OSM data (.osm.pbf) from [[https://download.geofabrik.de/|GeoFabrik]] or similar service for the interested area 
   * Check the documentation of the [[https://hub.docker.com/r/overv/openstreetmap-tile-server|openstreetmap-tile-server docker image]]   * Check the documentation of the [[https://hub.docker.com/r/overv/openstreetmap-tile-server|openstreetmap-tile-server docker image]]
-     * Create a docker volume for the OSM data: ''docker volume create osm-data'' +  * Create a docker volume for the OSM data: <code>docker volume create osm-data</code> 
-     * Import the downloaded .osm.pbf: ''docker run +  * Download the OSM data (.osm.pbf) from [[https://download.geofabrik.de/|GeoFabrik]] or similar service for the interested area 
-    -v /absolute/path/to/luxembourg.osm.pbf:/data/region.osm.pbf  +  * Import the downloaded .osm.pbf: <code> 
-    -v osm-data:/data/database/  +docker run \ 
-    overv/openstreetmap-tile-server  +    -v /absolute/path/to/luxembourg.osm.pbf:/data/region.osm.pbf \ 
-    import'' +    -v osm-data:/data/database/ \ 
-     Run the docker image''docker run  +    overv/openstreetmap-tile-server \ 
-    -p 8080:80  +    import  
-    -v osm-data:/data/database/  +</code> 
-    -d overv/openstreetmap-tile-server +  Or download and import the dataset with one command (no extra download required):<code> 
 +docker run \ 
 +    -e DOWNLOAD_PBF=https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf \ 
 +    -e DOWNLOAD_POLY=https://download.geofabrik.de/europe/luxembourg.poly \ 
 +    -v osm-data:/data/database/
 +    overv/openstreetmap-tile-server \ 
 +    import 
 +</code> 
 +  * The processing can take a long time (depending on assign/used CPU/disk/memory). The processing of Italy (about 2G of PBF data) takes about 2 hours. 
 +  * Note: The import is limited to one dataset (one pbf file). If you need more than one country/dataset you have to combine the datasets first, there are two options: 
 +      * using [[https://docs.osmcode.org/osmium/latest/osmium-merge.html|osmium-merge]]: <code> 
 +osmium merge washington.pbf oregon.pbf california.pbf -o westcoast.pbf 
 +</code> 
 +      * using [[https://wiki.openstreetmap.org/wiki/Osmconvert#Parallel_Processing|osmconvert]]:  <code> 
 +osmconvert washington.pbf --out-o5m | osmconvert - oregon.pbf -o=westcoast.pbf 
 +</code> 
 +  * Finally start the tile server: <code>docker run 
 +    --name osm-tile-server \ 
 +    -p 8080:80  \ 
 +    -v osm-data:/data/database/ \ 
 +    -d overv/openstreetmap-tile-server \
     run     run
-    ''+    </code> 
 + 
  
 +====== Styles ======
 +  * [[https://openmaptiles.org/styles/]]
  
 +====== Internal documentation ======
 + * [[https://gitlab.fn.terra4d.de/gitlab/fastprotect/terra3d/-/wikis/OpenStreetMap]]
  
terra4d/osmserver.1682083990.txt.gz · Last modified: 2023/04/21 13:33 by editor