User Tools

Site Tools


terra4d:osmserver

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
terra4d:osmserver [2023/11/22 07:03]
editor
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: <code>docker volume create osm-data</code> +  * Create a docker volume for the OSM data: <code>docker volume create osm-data</code> 
-     * Import the downloaded .osm.pbf: <code> +  * Download the OSM data (.osm.pbf) from [[https://download.geofabrik.de/|GeoFabrik]] or similar service for the interested area 
-docker run +  * Import the downloaded .osm.pbf: <code> 
-    -v /absolute/path/to/luxembourg.osm.pbf:/data/region.osm.pbf  +docker run \ 
-    -v osm-data:/data/database/  +    -v /absolute/path/to/luxembourg.osm.pbf:/data/region.osm.pbf 
-    overv/openstreetmap-tile-server +    -v osm-data:/data/database/
 +    overv/openstreetmap-tile-server \ 
 +    import  
 +</code> 
 +  * 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     import
 </code> </code>
-     Run the docker image: <code>docker run  +  * 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. 
-    -p 8080:80  +  * 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: 
-    -v osm-data:/data/database/  +      using [[https://docs.osmcode.org/osmium/latest/osmium-merge.html|osmium-merge]]: <code> 
-    -d overv/openstreetmap-tile-server +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>     </code>
  
  
 +
 +====== Styles ======
 +  * [[https://openmaptiles.org/styles/]]
 +
 +====== Internal documentation ======
 + * [[https://gitlab.fn.terra4d.de/gitlab/fastprotect/terra3d/-/wikis/OpenStreetMap]]
  
terra4d/osmserver.1700636629.txt.gz · Last modified: 2023/11/22 07:03 by editor