Expand description
This module loads the source data. The source is OSM
timezone-boundary-builder; datasets pick ocean cover (with-oceans or
land-only) and the zone set: now (64 zones, default), 1970
(304 zones), or all (444 zones).
The flow downloads the GeoJSON zip (with a conditional GET) and
parses it.
Functions§
- dataset_
url - Builds the URL of the TZBB release asset for a dataset, pinned to
release(so the bytes and the header tag can’t skew). In TZBB naming, the unsuffixed release is the “Comprehensive” set (μTZall), the-1970suffix is “Same since 1970”,-nowis “Same since now”, andwith-oceansselects ocean cover. - load_
geojson_ zip - Parses the first
.json/.geojsonentry of a TZBB release zip. - load_
tzbb - Downloads (revalidating) and parses a dataset into
Feats, returning the features plus the TZBB release tag they came from. - parse_
geojson - Deserializes a TZBB
GeoJSONFeatureCollectionintoFeats. - resolve_
release - Resolves the tag
releases/latestpoints at by reading its redirect (…/releases/tag/<tag>), so no API and no auth are needed. The tag is cached in<cache_dir>/tzbb-release.tagso offline regeneration keeps it, andUTZ_TZBB_RELEASEpins a tag explicitly (skipping the probe). With no network and no cached tag, the function falls back to"dev"with a warning; the per-release zip cache (tzbb/<release>/) will then be empty, so a first-ever offline run fails at download rather than serving mislabeled bytes.