Skip to content

feat: support projected bbox queries#11

Open
Geethen wants to merge 1 commit into
jakenotjay:mainfrom
Geethen:feat/query-bbox-crs
Open

feat: support projected bbox queries#11
Geethen wants to merge 1 commit into
jakenotjay:mainfrom
Geethen:feat/query-bbox-crs

Conversation

@Geethen

@Geethen Geethen commented Jul 8, 2026

Copy link
Copy Markdown

Problem

AEFIndex.query(bbox=...) currently assumes the bbox is already in WGS84, matching the index geometry. Callers that work in a projected CRS need to reproject their AOI before querying, and a corner-only reprojection can under-cover projected rectangles whose edges bow in WGS84.

Fix

Adds an optional bbox_crs argument to AEFIndex.query, defaulting to "EPSG:4326" so existing calls keep the same behavior. When bbox_crs is projected, the bbox is converted to WGS84 with Transformer.transform_bounds(..., densify_pts=21) before intersecting the index.

Tests

Adds tests/test_index.py coverage for:

  • querying with a projected bbox and getting the same tiles as the equivalent WGS84 bbox
  • a high-latitude UTM bbox where densified bounds expand beyond corner-only bounds

Ran locally:

uv run pytest tests/test_index.py
uv run ruff check aef_loader/index.py tests/test_index.py

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