create-stac-collection: the bbox is the extent of the geometries - #59
ivorbosloper wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es (vecorel/cli#59) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
How much weight/time does this add on top of especially larger files? I feel like the small divergence can be okay if it adds too much overhead on top of writing and portolan might be overly rigurous here. Or we add a strict mode here as well 😅 |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified, and regression coverage is included.
Review effort: Lite
Findings: None
What changed in this PR
Updates create-stac-collection to calculate accurate STAC bounding boxes from geometries transformed to EPSG:4326.
Changes:
- Computes geometry-based extents.
- Preserves the EPSG:4326 fast path.
- Adds regression coverage and changelog documentation.
| File | Summary |
|---|---|
vecorel_cli/create_stac.py |
Computes accurate geometry-based STAC extents. |
tests/test_create_stac.py |
Tests projected-CRS bbox behavior. |
CHANGELOG.md |
Documents the correction. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Yes. It's slower. Measured with 1M fake parcels in EPSG:25833 with about 17 vertices each: 0.03s now 1.7 seconds . The largest data set (France, 10M) would add 15-20secs.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I guess that works, wasn't sure whether it may take much longer than a minute. I'd hope Japan works? Otherwise, I'm thinking we may want a switch to disable it. |
create-stac-collectiontransformed the corners of the source bbox to EPSG:4326. In a projected CRS those corners reach beyond the data, so the collection's bbox was too wide (for Saxony in EPSG:25833 about 0.08° on the west side). It now transforms the geometries and takes their extent, skipping the transform for data already in EPSG:4326.PTL-DAT-005on the harmonized field data catalog, where the PMTiles (tippecanoe writes the true extent) disagreed with the declared bbox for every collection in a projected CRS.🤖 Generated with Claude Code