DOV-Vlaanderen/pydov

Missing attribute: soil type

dluts opened this issue · 4 comments

dluts commented
  • PyDOV version: 2.1.0
  • Python version: 3.7
  • Operating System: Windows 10

Description

I want to use PyDOV to access soil obseravations and soil locations depending on the soil type attribute of the soil location. The soil type attribute is necessary to be able to do targetted request and to be able to analyse the data for example to determine the distribution of a soil parameter through the soil profile for a specific soil type.

What I Did

Followed the relevant code examples in the tutorial:

fields = bodemlocatie.get_fields()
for f in fields.values():
    print(f['name'])

from owslib.fes import PropertyIsEqualTo
  query = PropertyIsEqualTo(propertyname='bodemstreek',literal='Zandstreek')
  df = bodemlocatie.search(query=query, max_features=10)
df.head()
Roel commented

To be able to use the field in a search query, it would need to be added to the WFS layer. I believe it is currently missing because this is not a single attribute of the soil location as there can be more than 1 classification (there is a field aantal_classificaties) of the soil type (e.g. Belgian, WRB).

However, it might be feasible to add a classificaties field with a commaseparated list of classification(codes), that would allow querying with a PropertyIsLike operator? @jorissynaeve thoughts?

There is a WFS layer 'bodem:bodemclassificaties', with a feature catalogue (https://www.dov.vlaanderen.be/geonetwork/srv/api/records/9ace8d74-8daa-461f-86bb-273573bc7fa9/formatters/xml).
And there is xml-support. (eg https://www.dov.vlaanderen.be/data/belgischebodemclassificatie/2018-000060.xml)

So, why not create a new search module for soil classifications?
I suppose this search can be joined with other searches?

Roel commented

Yes, this would also work. I'd prefer this as it is more in line with the soil datamodel and can be supported with current DOV webservices, so we don't need to make changes there.

dluts commented

Looks good, I was initially thinking of a similar system as the DOV explorer where one classification is shown in the soil type attribute. But having access to all classifications would allow for a lot more flexibility.