availability of 'Glauconiet' - glauconite info in pyDOV
denilka opened this issue · comments
In DOV there are 4 possible fields to fill in information about glauconite-content. In pyDOV, only 'glauconiet' is mentioned. Which one is present in export pyDOV. the attribute is named 'glauconiet'. It would be usefull to add all the glauconiet-fields of the database in pyDOV, so glauconiet totaal, glauconiet_KL63, glauconiet_TSS en glauconiet_GR500.
F.e.: this sample has info in the 4 glauconite-attributes in DOV. https://www.dov.vlaanderen.be/data/grondmonster/2017-172111
Indeed, only glauconiet_totaal was added to the default dataframe. I will change the name accordingly to overcome confusion. Not all possible components are included in the dataframe because it would become too large. You can of course add the desired outputs following the guidelines in the Notebook on customizing object types, as given in the example below:
from pydov.types.fields import XmlField
from owslib.fes import PropertyIsEqualTo
from pydov.search.grondmonster import GrondmonsterSearch
from pydov.types.grondmonster import Grondmonster
class GlauconietWaarden(Grondmonster):
fields = Grondmonster.extend_fields([
XmlField(name='glauconiet_totaal',
source_xpath='/grondmonster/observatieData/observatie['
'parameter="GLAUCONIET_TOTAAL"]/waarde_numeriek',
definition='GLAUCONIET_TOTAAL',
datatype='float',),
XmlField(name='glauconiet_tss',
source_xpath='/grondmonster/observatieData/observatie['
'parameter="GLAUCONIET_TSS"]/'
'waarde_numeriek',
definition='GLAUCONIET_TSS',
datatype='float',),
XmlField(name='glauconiet_gt500',
source_xpath='/grondmonster/observatieData/observatie['
'parameter="GLAUCONIET_GT500"]/'
'waarde_numeriek',
definition='GLAUCONIET_GT500',
datatype='float',),
XmlField(name='glauconiet_kl63',
source_xpath='/grondmonster/observatieData/observatie['
'parameter="GLAUCONIET_KL63"]/'
'waarde_numeriek',
definition='GLAUCONIET_KL63',
datatype='float',)
])
gm = GrondmonsterSearch(objecttype=GlauconietWaarden)
# Drop glauconiet attribute while not yet changed in master version
gm._fields.pop('glauconiet')
query = PropertyIsEqualTo(propertyname='pkey_grondmonster',
literal='https://www.dov.vlaanderen.be/data/grondmonster/2017-172111')
df = gm.search(query=query)
We might also add this example to the notebook with other custom object types? At some point we might also include these in the code so they can be used more easily.