Tile large DHMV coverage requests
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 18:50:03 +02:00
parent 92498fb7eb
commit daf9cef01b
2 changed files with 172 additions and 6 deletions
@@ -167,6 +167,29 @@ def test_dhmv_request_rejects_unsafe_size_and_resolution() -> None:
DhmvAcquireRequest.model_validate(payload.model_dump())
def test_dhmv_large_scope_is_bounded_into_mosaicable_wcs_tiles() -> None:
prepared = DhmvAcquisitionService._prepared_request(
lambert_bbox_payload(side_m=15_000.0),
Settings(_env_file=None),
)
tile_bounds = DhmvAcquisitionService._tile_bounds(prepared)
assert len(tile_bounds) == 4
assert all(bounds[2] - bounds[0] <= 10_000.0 for bounds in tile_bounds)
assert all(bounds[3] - bounds[1] <= 10_000.0 for bounds in tile_bounds)
left = elevation_tiff(left=200_000, top=210_100, width=20, height=20)
right = elevation_tiff(left=200_100, top=210_100, width=20, height=20)
mosaic = DhmvAcquisitionService._mosaic_geotiffs([left, right])
with MemoryFile(mosaic) as memory, memory.open() as dataset:
assert dataset.crs.to_epsg() == 31370
assert dataset.res == pytest.approx((5.0, 5.0))
assert dataset.width == 40
assert dataset.height == 20
assert dataset.nodata == -9999.0
def test_dhmv_multipart_geotiff_is_extracted_and_invalid_response_fails_closed() -> None:
tiff = elevation_tiff(left=200_000, top=210_100, width=20, height=20)
multipart, content_type = multipart_tiff(tiff)