fix(map): honor raster coverage and temporal dates
This commit is contained in:
@@ -133,6 +133,20 @@ def temporal_dataset(*, project_id, observed_year: int, metric_method: str = "fe
|
||||
)
|
||||
|
||||
|
||||
def test_temporal_series_keeps_only_latest_snapshot_per_observation_date() -> None:
|
||||
project_id = uuid4()
|
||||
old = temporal_dataset(project_id=project_id, observed_year=2025)
|
||||
old.imported_at = datetime(2026, 7, 19, tzinfo=timezone.utc)
|
||||
latest = temporal_dataset(project_id=project_id, observed_year=2025)
|
||||
latest.imported_at = datetime(2026, 7, 21, tzinfo=timezone.utc)
|
||||
earlier = temporal_dataset(project_id=project_id, observed_year=2022)
|
||||
earlier.imported_at = datetime(2026, 7, 21, tzinfo=timezone.utc)
|
||||
|
||||
canonical = TemporalAnalysisService._canonical_observation_snapshots([old, latest, earlier])
|
||||
|
||||
assert [dataset.id for dataset in canonical] == [earlier.id, latest.id]
|
||||
|
||||
|
||||
def governed_grb_dataset(*, project_id, observed_day: int) -> Dataset:
|
||||
dataset = temporal_dataset(project_id=project_id, observed_year=2026, metric_method="intersection_area")
|
||||
dataset.observed_at = datetime(2026, 7, observed_day, tzinfo=timezone.utc)
|
||||
|
||||
@@ -16,7 +16,7 @@ def test_flanders_workspace_exposes_governed_thematic_products_on_demand() -> No
|
||||
|
||||
assert "activeScopeProject?.name === FLANDERS_WORKSPACE_PROJECT_NAME" in workspace
|
||||
assert "new Map<DataThemeId, OnDemandMapProduct>" in workspace
|
||||
assert "'Op aanvraag'" in workspace
|
||||
assert "'Automatisch'" in workspace
|
||||
assert "theme.id === 'space_occupation'" in workspace
|
||||
assert "setActiveThemeId(fallbackTheme.id)" in workspace
|
||||
assert "return `referentiejaar ${observationYear}`" in workspace
|
||||
|
||||
@@ -391,6 +391,6 @@ def test_grb_frontend_and_contracts_use_only_the_governed_backend_path() -> None
|
||||
assert "result[product.key] = null" in workspace
|
||||
assert ": onDemandThemeActive\n ? null\n : mapFeatureCollection" in workspace
|
||||
assert "onSetContextLayerLabel" in workspace
|
||||
assert "'Op aanvraag'" in workspace
|
||||
assert "'Automatisch'" in workspace
|
||||
assert "/datasets/grb/acquire" in contracts
|
||||
assert "geo.api.vlaanderen.be" not in workspace
|
||||
|
||||
Reference in New Issue
Block a user