Skip to main content

Module loader

Module loader 

Source
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 (μTZ all), the -1970 suffix is “Same since 1970”, -now is “Same since now”, and with-oceans selects ocean cover.
load_geojson_zip
Parses the first .json/.geojson entry 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 GeoJSON FeatureCollection into Feats.
resolve_release
Resolves the tag releases/latest points 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.tag so offline regeneration keeps it, and UTZ_TZBB_RELEASE pins 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.