diff --git a/CHANGELOG.md b/CHANGELOG.md index b2d5c6ca2..8edd7bf79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ - New Topics and Project for UNICEF education access project have been added ([#832]) +### Bug Fixes + +- fix: global coverage is now returned correctly ([#821]) + + +[#821]: https://github.com/GIScience/ohsome-quality-api/issues/821 + ## Release 1.5.0 diff --git a/ohsome_quality_api/indicators/base.py b/ohsome_quality_api/indicators/base.py index fd81da468..03505bcfb 100644 --- a/ohsome_quality_api/indicators/base.py +++ b/ohsome_quality_api/indicators/base.py @@ -132,7 +132,7 @@ async def coverage(cls, inverse=False) -> list[Feature]: ) ] else: - return [Feature(Polygon(coordinates=[]))] + return [Feature(geometry=Polygon(coordinates=[]))] @abstractmethod async def preprocess(self) -> None: diff --git a/tests/integrationtests/test_base_indicator.py b/tests/integrationtests/test_base_indicator.py index b045b448a..838c3eaf9 100644 --- a/tests/integrationtests/test_base_indicator.py +++ b/tests/integrationtests/test_base_indicator.py @@ -65,15 +65,18 @@ def test_coverage(self): for feature in coverage: assert isinstance(feature, Feature) assert feature.is_valid + assert feature["geometry"] is not None coverage_default = asyncio.run(Minimal.coverage()) for feature in coverage_default: assert isinstance(feature, Feature) assert feature.is_valid + assert feature["geometry"] is not None assert coverage_default == coverage coverage_inversed = asyncio.run(Minimal.coverage(inverse=True)) for feature in coverage_inversed: assert isinstance(feature, Feature) assert feature.is_valid + assert feature["geometry"] is not None assert coverage != coverage_inversed assert coverage_default != coverage_inversed