Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: global coverage geojson #836

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ohsome_quality_api/indicators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions tests/integrationtests/test_base_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down