Preserve native orthophoto detail for training
This commit is contained in:
@@ -92,6 +92,7 @@ def _selection_payload(
|
||||
force_refresh: bool = True,
|
||||
area_id=None,
|
||||
product_key: str = "most_recent",
|
||||
resolution_m: float | None = None,
|
||||
) -> OrthophotoAcquireRequest:
|
||||
west, south = 199_000.0, 210_000.0
|
||||
transformer = Transformer.from_crs("EPSG:31370", "EPSG:4326", always_xy=True)
|
||||
@@ -108,6 +109,7 @@ def _selection_payload(
|
||||
area_id=area_id,
|
||||
product_key=product_key,
|
||||
force_refresh=force_refresh,
|
||||
resolution_m=resolution_m,
|
||||
)
|
||||
|
||||
|
||||
@@ -143,6 +145,21 @@ def test_orthophoto_request_is_bounded_and_uses_official_wms_contract() -> None:
|
||||
assert len(prepared["request_hash"]) == 64
|
||||
|
||||
|
||||
def test_training_request_can_use_native_resolution_but_not_oversample_source() -> None:
|
||||
settings = Settings(_env_file=None)
|
||||
prepared = OrthophotoAcquisitionService._prepared_request(
|
||||
_selection_payload(product_key="wallonia_latest", resolution_m=0.25), settings
|
||||
)
|
||||
assert 2_000 <= prepared["width"] <= 2_120
|
||||
assert prepared["resolution_m"] == 0.25
|
||||
|
||||
with pytest.raises(AppError) as exc_info:
|
||||
OrthophotoAcquisitionService._prepared_request(
|
||||
_selection_payload(product_key="wallonia_latest", resolution_m=0.1), settings
|
||||
)
|
||||
assert exc_info.value.code == "ORTHOPHOTO_RESOLUTION_EXCEEDS_SOURCE"
|
||||
|
||||
|
||||
def test_orthophoto_product_registry_exposes_only_governed_official_layers() -> None:
|
||||
settings = Settings(_env_file=None)
|
||||
products = OrthophotoAcquisitionService.list_products(settings)
|
||||
|
||||
Reference in New Issue
Block a user