Adds convenience scripts to download coastline and landuse data, see #720 (#723)

This commit is contained in:
Daniel J. H
2024-05-28 16:58:02 +02:00
committed by GitHub
parent b89b0ebd7e
commit 253b3cb8e4
4 changed files with 70 additions and 4 deletions
+11 -4
View File
@@ -50,10 +50,6 @@ tilemaker keeps everything in RAM by default. To process large areas without run
tilemaker /path/to/your/input.osm.pbf /path/to/your/output.mbtiles --store /path/to/your/ssd
To include sea tiles, create a directory called `coastline` in the same place you're running tilemaker from, and then save the files from https://osmdata.openstreetmap.de/download/water-polygons-split-4326.zip in it, such that tilemaker can find a file at `coastline/water_polygons.shp`.
_(If you want to include optional small-scale landcover, create a `landcover` directory, and download the appropriate 10m files from 'Features' at https://www.naturalearthdata.com so that you have `landcover/ne_10m_antarctic_ice_shelves_polys/ne_10m_antarctic_ice_shelves_polys.shp`, `landcover/ne_10m_urban_areas/ne_10m_urban_areas.shp`, `landcover/ne_10m_glaciated_areas/ne_10m_glaciated_areas.shp`.)_
Then, to serve your tiles using the demonstration server:
cd server
@@ -61,6 +57,17 @@ Then, to serve your tiles using the demonstration server:
You can now navigate to http://localhost:8080/ and see your map!
## Coastline and Landcover
To include sea tiles and small-scale landcover, run
./get-coastline.sh
./get-landcover.sh
This will download coastline and landcover data; you will need around 2GB disk space.
Have a look at the coastline and landcover example in the [`resources/`](./resources) directory.
## Your own configuration
Vector tiles contain (generally thematic) 'layers'. For example, your tiles might contain river, cycleway and railway layers. It's up to you what OSM data goes into each layer. You configure this in tilemaker with two files:
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
mkdir -p coastline
pushd coastline
if ! [ -f "water-polygons-split-4326.zip" ]; then
curl --proto '=https' --tlsv1.3 -sSfO https://osmdata.openstreetmap.de/download/water-polygons-split-4326.zip
fi
unzip -o -j water-polygons-split-4326.zip
popd
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
mkdir -p landcover
pushd landcover
if ! [ -f "ne_10m_antarctic_ice_shelves_polys.zip" ]; then
curl --proto '=https' --tlsv1.3 -sSfO https://naciscdn.org/naturalearth/10m/physical/ne_10m_antarctic_ice_shelves_polys.zip
fi
if ! [ -f "ne_10m_urban_areas.zip" ]; then
curl --proto '=https' --tlsv1.3 -sSfO https://naciscdn.org/naturalearth/10m/cultural/ne_10m_urban_areas.zip
fi
if ! [ -f "ne_10m_glaciated_areas.zip" ]; then
curl --proto '=https' --tlsv1.3 -sSfO https://naciscdn.org/naturalearth/10m/physical/ne_10m_glaciated_areas.zip
fi
mkdir -p ne_10m_antarctic_ice_shelves_polys
unzip -o ne_10m_antarctic_ice_shelves_polys.zip -d ne_10m_antarctic_ice_shelves_polys
mkdir -p ne_10m_urban_areas
unzip -o ne_10m_urban_areas.zip -d ne_10m_urban_areas
mkdir -p ne_10m_glaciated_areas
unzip -o ne_10m_glaciated_areas.zip -d ne_10m_glaciated_areas
popd
Executable
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
if ! [ -f "monaco-latest.osm.pbf" ]; then
curl --proto '=https' --tlsv1.3 -sSfO https://download.geofabrik.de/europe/monaco-latest.osm.pbf
fi