From 9a0baa2ed39b07e7ba2b68fce5a2831327556afc Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Tue, 3 Mar 2026 18:04:43 -0500 Subject: [PATCH 1/2] add DuckDB script for downloading monaco or a custom area from Overture as Parquet file [#541] --- tiles/download-overture.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 tiles/download-overture.sh diff --git a/tiles/download-overture.sh b/tiles/download-overture.sh new file mode 100755 index 00000000..997fab1a --- /dev/null +++ b/tiles/download-overture.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +REL="${1:-2026-02-18.0}" +BBOX="${2:-7.408446,43.722901,7.4405,43.752481}" +OUT="data/sources/${3:-monaco.parquet}" + +IFS=',' read -r XMIN YMIN XMAX YMAX <<< "$BBOX" + +echo "Downloading release $REL: $BBOX to $OUT" + +duckdb -c " +COPY ( + SELECT * + FROM read_parquet( + 's3://overturemaps-us-west-2/release/${REL}/**/*.parquet', + hive_partitioning=1, filename=1, union_by_name=1 + ) + WHERE theme IN ('transportation','places','base','buildings','divisions') + AND bbox.xmin <= ${XMAX} + AND bbox.xmax >= ${XMIN} + AND bbox.ymin <= ${YMAX} + AND bbox.ymax >= ${YMIN} +) TO '${OUT}' (FORMAT PARQUET);" + +echo "Wrote ${OUT}" \ No newline at end of file From 295dfe42f128558337126067066761e12c0a8a0f Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Mon, 13 Jul 2026 14:24:11 -0400 Subject: [PATCH 2/2] Overture download script [#571] * add bash help text * query for latest Overture release from STAC catalog --- tiles/download-overture.sh | 42 +++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/tiles/download-overture.sh b/tiles/download-overture.sh index 997fab1a..a1842ccf 100755 --- a/tiles/download-overture.sh +++ b/tiles/download-overture.sh @@ -1,9 +1,45 @@ #!/usr/bin/env bash set -euo pipefail -REL="${1:-2026-02-18.0}" -BBOX="${2:-7.408446,43.722901,7.4405,43.752481}" -OUT="data/sources/${3:-monaco.parquet}" +STAC_CATALOG="https://stac.overturemaps.org/catalog.json" +DEFAULT_BBOX="7.408446,43.722901,7.4405,43.752481" +DEFAULT_OUT="data/sources/monaco.parquet" + +usage() { + cat </dev/null || true +} + +if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then + usage + exit 0 +fi + +REL="${1:-$(latest_release)}" +if [[ -z "$REL" ]]; then + echo "Could not determine the latest release from ${STAC_CATALOG}; pass one explicitly." >&2 + exit 1 +fi +BBOX="${2:-$DEFAULT_BBOX}" +OUT="${3:-$DEFAULT_OUT}" IFS=',' read -r XMIN YMIN XMAX YMAX <<< "$BBOX"