Skip to content

Commit 6b41faa

Browse files
committed
add DuckDB script for downloading monaco or a custom area from Overture as Parquet file [#541]
1 parent e7fca87 commit 6b41faa

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

tiles/download-overture.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
REL="${1:-2026-02-18.0}"
5+
BBOX="${2:-7.408446,43.722901,7.4405,43.752481}"
6+
OUT="data/sources/${3:-monaco.parquet}"
7+
8+
IFS=',' read -r XMIN YMIN XMAX YMAX <<< "$BBOX"
9+
10+
echo "Downloading release $REL: $BBOX to $OUT"
11+
12+
duckdb -c "
13+
COPY (
14+
SELECT *
15+
FROM read_parquet(
16+
's3://overturemaps-us-west-2/release/${REL}/**/*.parquet',
17+
hive_partitioning=1, filename=1, union_by_name=1
18+
)
19+
WHERE theme IN ('transportation','places','base','buildings','divisions')
20+
AND bbox.xmin <= ${XMAX}
21+
AND bbox.xmax >= ${XMIN}
22+
AND bbox.ymin <= ${YMAX}
23+
AND bbox.ymax >= ${YMIN}
24+
) TO '${OUT}' (FORMAT PARQUET);"
25+
26+
echo "Wrote ${OUT}"

0 commit comments

Comments
 (0)