Skip to content

support overture maps division datasets - #151

Merged
missinglink merged 2 commits into
masterfrom
overture
Oct 7, 2026
Merged

missinglink merged 2 commits into
masterfrom
overture

Conversation

@missinglink

@missinglink missinglink commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

this PR adds support for the Overture Maps division and division_area themes.

note: the overturemaps cli command is required to download the data.
note: requires duckdb

Screenshot 2026-10-06 at 11 42 38

@missinglink

Copy link
Copy Markdown
Member Author

I added a second commit which changes the ingress from the official OvertureMaps CLI to duckdb wrapped in a helper function (embedded below).

This has advantages of us being able to perform arbitrary SQL queries and not be limited to the available functionality of the official CLI (plus we don't need to install a python app).

spatial/README.md

Lines 304 to 346 in 867450e

# Overture Helper Function
The Overture import requires a bash helper function to query DuckDB against S3 parquet files. Copy this function to your shell or save it to a file and source it:
```bash
overture_export_geojson_by_bbox() {
local theme="${1:?Missing theme (e.g., divisions, buildings, places)}"
local type="${2:?Missing type (e.g., division_area, division_boundary)}"
local xmin="${3:?Missing xmin (western longitude)}"
local ymin="${4:?Missing ymin (southern latitude)}"
local xmax="${5:?Missing xmax (eastern longitude)}"
local ymax="${6:?Missing ymax (northern latitude)}"
local OVERTURE_RELEASE="2026-09-23.1"
local S3_BASE="s3://overturemaps-us-west-2/release/${OVERTURE_RELEASE}"
duckdb -noheader -list -c "
INSTALL spatial; LOAD spatial;
WITH data AS (
SELECT *, row_number() OVER () as rn
FROM read_parquet('${S3_BASE}/theme=${theme}/type=${type}/*', filename=true, hive_partitioning=1)
WHERE bbox.xmin < ${xmax} AND bbox.xmax > ${xmin}
AND bbox.ymin < ${ymax} AND bbox.ymax > ${ymin}
)
SELECT json_object(
'id', data.id,
'type', 'Feature',
'geometry', ST_AsGeoJSON(data.geometry)::JSON,
'properties', (SELECT to_json(r) FROM (SELECT * EXCLUDE (id, geometry, filename, theme, type, rn) FROM data d WHERE d.rn = data.rn) r)
)
FROM data;
"
}
```
**Usage:**
```bash
# Export division areas for New Zealand
overture_export_geojson_by_bbox divisions division_area 165 -48 179 -34
# Export division points for Indonesia
overture_export_geojson_by_bbox divisions division 106 -7 107 -6
```

@missinglink
missinglink merged commit ec82e1d into master Oct 7, 2026
6 checks passed
@missinglink
missinglink deleted the overture branch October 7, 2026 14:08
deliveree-pdc pushed a commit to deliveree-pdc/pelias-spatial that referenced this pull request Oct 28, 2026
…ias-spatial

* upstream/master: (49 commits)
  import(overture): support overture maps `division` datasets (pelias#151)
  feat(deps)!: update node engine to >=22.0.0
  feat(deps): update pelias-whosonfirst to ^9.0.0
  feat(deps): update pelias-logger to ^2.0.0
  feat(deps): update pelias-config to ^7.0.0
  feat(deps): pin better-sqlite3 to latest and approve install scripts
  fix(whosonfirst): update WOF spec (pelias#150)
  fix(import): Catch warning from unsupported hierarchy entries (pelias#149)
  fix(osm): Use `postalcode` layer instead of `postal_code` (pelias#147)
  Remove Node.js 20.x from CI
  fix(docs): Replace broken whosonfirst.org URLS with geocode.earth/data
  feat(wof): Use shared getDefaultName from wof package
  fix(wof): match record validity logic to placeholder
  feat(deps): Upgrade to better-sqlite3 v 12.10.0
  Add Node.js 26.x to CI
  feat(demo): fix flag icons, role prefixes (pelias#145)
  chore: add MIT license file
  CI: update GitHub Actions versions
  feat(Docker): Remove unused apt dependencies (pelias#144)
  feat(npm): configure CI for NPM OIDC Tokens (pelias#143)
  ...

# Conflicts:
#	Dockerfile
#	service/QueryService.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant