From 6b41faa7216f4e6742ea5f7a2b1b2eb1bfe2d1dc Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Tue, 3 Mar 2026 18:04:43 -0500 Subject: [PATCH] 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