Pass --download to Planetiler for its auxiliary OpenMapTiles sources
Real build failure once the tmp-filename fix got past the format- detection error: "data/sources/lake_centerline.shp.zip does not exist. Run with --download to fetch it". The OpenMapTiles profile needs a few small non-OSM sources (water polygons, Natural Earth, lake centerlines) alongside the .osm.pbf itself, and Planetiler only fetches them when told to. They land under its own default data/sources/, gitignored alongside the rest of data/ — fetched once, reused by every later build.
This commit is contained in:
1 parent
b54020e23b
commit
d09d953cbf
2 files changed
+16
-1
No files matched your search
@@ -16,6 +16,13 @@
|
|||||||
# also local-only — see PmtilesBuilder.cached_extract)
|
# also local-only — see PmtilesBuilder.cached_extract)
|
||||||
/data/geofabrik_cache/
|
/data/geofabrik_cache/
|
||||||
|
|
||||||
|
# Planetiler's own auxiliary-source cache and scratch working directory
|
||||||
|
# (water polygons/Natural Earth/lake centerlines, --download; temp feature
|
||||||
|
# DBs, --tmpdir) — relative to the app's CWD, which lands them here
|
||||||
|
# alongside the rest of data/ (see extract_offline's --download comment)
|
||||||
|
/data/sources/
|
||||||
|
/data/tmp/
|
||||||
|
|
||||||
# Offline Wikipedia ZIM for kiwix-serve (also large, also local-only —
|
# Offline Wikipedia ZIM for kiwix-serve (also large, also local-only —
|
||||||
# same story, see docs/development.adoc)
|
# same story, see docs/development.adoc)
|
||||||
/data/kiwix/*
|
/data/kiwix/*
|
||||||
|
|||||||
@@ -268,7 +268,15 @@ module Maptool
|
|||||||
# suffix made it fail with "Unsupported format tmp" instead of
|
# suffix made it fail with "Unsupported format tmp" instead of
|
||||||
# actually tiling anything.
|
# actually tiling anything.
|
||||||
tmp_path = File.join(data_dir, "offline.tmp.pmtiles")
|
tmp_path = File.join(data_dir, "offline.tmp.pmtiles")
|
||||||
run_planetiler!("--osm-path=#{osm_path}", "--output=#{tmp_path}")
|
# --download: the OpenMapTiles profile also needs a few small auxiliary
|
||||||
|
# sources (water polygons, Natural Earth, lake centerlines) alongside
|
||||||
|
# the OSM extract itself — without this flag Planetiler expects them
|
||||||
|
# to already exist on disk and fails instead of fetching them. They
|
||||||
|
# land under Planetiler's own default "data/sources/", relative to
|
||||||
|
# this process's working directory (the app root, so in practice
|
||||||
|
# that's data_dir's own "sources" subdirectory) — fetched once,
|
||||||
|
# reused by every later build.
|
||||||
|
run_planetiler!("--osm-path=#{osm_path}", "--output=#{tmp_path}", "--download")
|
||||||
File.rename(tmp_path, File.join(data_dir, "offline.pmtiles"))
|
File.rename(tmp_path, File.join(data_dir, "offline.pmtiles"))
|
||||||
File.write(offline_meta_path(data_dir), JSON.generate(sources: sources.map { |s| s.slice("code", "slug", "last_modified") }))
|
File.write(offline_meta_path(data_dir), JSON.generate(sources: sources.map { |s| s.slice("code", "slug", "last_modified") }))
|
||||||
ensure
|
ensure
|
||||||
|
|||||||
Reference in new issue
Block a user