Pass --download to Planetiler for its auxiliary OpenMapTiles sources
CI / check (push) Successful in 18s
CI / deploy (push) Successful in 13s

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:
randy committed 2026-09-11 23:28:07 +02:00
1 parent b54020e23b
commit d09d953cbf
2 files changed
+16 -1

No files matched your search

+9 -1
View File
@@ -268,7 +268,15 @@ module Maptool
# suffix made it fail with "Unsupported format tmp" instead of
# actually tiling anything.
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.write(offline_meta_path(data_dir), JSON.generate(sources: sources.map { |s| s.slice("code", "slug", "last_modified") }))
ensure