Skip to content

breaking: rename lulc topic to land-cover and change filter #907

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

Merged
merged 3 commits into from
Jun 3, 2025
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

- api: move all request validation to Pydantic request models with the help of ContextVars (make request path parameters available to request models) ([#852])
- build: add scikit-learn and pytest-asyncio dependencies ([#893])
- topics: `lulc` topic renamed to `land-cover` and has a new filter ([#898])
- build: use uv instead of poetry for package and project management ([#904])
- build: bump geojson-pydantic version from 1.x to 2.x
- build: remove scipy and toml dependencies
Expand All @@ -25,6 +26,7 @@
[#876]: https://github.com/GIScience/ohsome-quality-api/pull/876
[#883]: https://github.com/GIScience/ohsome-quality-api/issues/883
[#893]: https://github.com/GIScience/ohsome-quality-api/pull/893
[#898]: https://github.com/GIScience/ohsome-quality-api/issues/898
[#904]: https://github.com/GIScience/ohsome-quality-api/pull/904

## Release 1.9.0
Expand Down
13 changes: 2 additions & 11 deletions ohsome_quality_api/topics/presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -547,23 +547,14 @@ mapaction-rivers-length:

### IDEALVGI PROJECT ###

lulc:
land-cover:
name: Land Use and Land Cover
description: >-
Features related to land use and land cover.
This definition includes well established tags for coherent areas at the most atomic level available.
This definition therefore excludes areas with the keys aeroway, highway, leisure and tourism which can be found in other sources.
For further details please contact us.
endpoint: elements
aggregation_type: area
filter: >-
(landuse=allotments or landuse=animal_keeping or landuse=basin or landuse=brownfield or landuse=cemetery or landuse=churchyard or landuse=civic_admin or landuse=commercial or landuse=construction or landuse=depot or landuse=education or landuse=farmland or landuse=farmyard or landuse=forest or landuse=garages or landuse=grass or landuse=greenfield or landuse=greenhouse_horticulture or landuse=harbour or landuse=industrial or landuse=landfill or landuse=logging or landuse=meadow or landuse=military or landuse=orchard or landuse=plant_nursery or landuse=port or landuse=quarry or landuse=railway or landuse=recreation_ground or landuse=religious or landuse=reservoir or landuse=residential or landuse=retail or landuse=salt_pond or landuse=village_green or landuse=vineyard or natural=bare_rock or natural=beach or natural=dune or natural=fell or natural=glacier or natural=grassland or natural=heath or natural=landslide or natural=mud or natural=rock or natural=sand or natural=scree or natural=scrub or natural=shingle or natural=water or natural=wetland or natural=wood or waterway=boatyard or waterway=dam or waterway=dock or waterway=riverbank) and geometry:polygon
source: >-
https://osmlanduse.org;
Fonte et al 2016 https://cartography-gis.com/docsbca/iccgis2016/ICCGIS2016-47.pdf;
https://github.com/jasp382/glass/tree/master/core/glass/ete/osm2lulc;
Schultz et al 2017 https://doi.org/10.1016/j.jag.2017.07.014;
https://www.geog.uni-heidelberg.de/gis/ideal_en.html
(landuse=* and landuse!=no) or natural=water and geometry:polygon
indicators:
- mapping-saturation
- currentness # currentness always requests /contributions/latest/count [count!]
Expand Down
5 changes: 0 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ def topic_major_roads_length() -> TopicDefinition:
return get_topic_preset("roads")


@pytest.fixture
def topic_lulc() -> TopicDefinition:
return get_topic_preset("lulc")


@pytest.fixture(scope="class")
def attribute_key_height() -> List[str]:
return ["height"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def fetch(*_):
)
def test_multi_class(client, bpolys, headers, schema, mock_db_fetch):
# corine class parameter is optional (default all corine classes)
parameters = {"bpolys": bpolys, "topic": "lulc"}
parameters = {"bpolys": bpolys, "topic": "land-cover"}
response = client.post(ENDPOINT, json=parameters, headers=headers)
assert response.status_code == 200
assert schema.is_valid(response.json())
Expand All @@ -54,7 +54,7 @@ def test_multi_class(client, bpolys, headers, schema, mock_db_fetch):
)
def test_single_class(client, bpolys, headers, schema, mock_db_fetch):
# Corine class 23 are Pastures
parameters = {"bpolys": bpolys, "topic": "lulc", "corineLandCoverClass": "23"}
parameters = {"bpolys": bpolys, "topic": "land-cover", "corineLandCoverClass": "23"}
response = client.post(ENDPOINT, json=parameters, headers=headers)
assert response.status_code == 200
assert schema.is_valid(response.json())
Expand All @@ -68,7 +68,7 @@ def test_invalid_topic(client, bpolys):


def test_invalid_class(client, bpolys):
parameters = {"bpolys": bpolys, "topic": "lulc", "corineLandCoverClass": "1"}
parameters = {"bpolys": bpolys, "topic": "land-cover", "corineLandCoverClass": "1"}
response = client.post(ENDPOINT, json=parameters)
assert response.status_code == 422
verify_as_json(response.json(), options=Options().with_namer(PytestNamer()))
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def feature():

@pytest.fixture
def topic() -> TopicDefinition:
return get_topic_preset("lulc")
return get_topic_preset("land-cover")


@pytest.fixture
Expand Down
6 changes: 3 additions & 3 deletions tests/unittests/api/test_request_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_land_cover_thematic_accuracy_request(
bpolys, mock_request_context_land_cover_thematic_accuracy
):
# corine class parameter is optional (default all corine classes)
LandCoverThematicAccuracyRequest(bpolys=bpolys, topic="lulc")
LandCoverThematicAccuracyRequest(bpolys=bpolys, topic="land-cover")


def test_land_cover_thematic_accuracy_request_invalid_topic(
Expand All @@ -195,10 +195,10 @@ def test_land_cover_thematic_accuracy_request_corine_class(
):
# Corine class 23 represents Pastures
LandCoverThematicAccuracyRequest(
bpolys=bpolys, topic="lulc", corine_land_cover_class="23"
bpolys=bpolys, topic="land-cover", corine_land_cover_class="23"
)
with pytest.raises(Exception):
# Corine class 1 is invalid
LandCoverThematicAccuracyRequest(
bpolys=bpolys, topic="lulc", corine_land_cover_class="1"
bpolys=bpolys, topic="land-cover", corine_land_cover_class="1"
)