예제 #1
0
파일: boring.py 프로젝트: rebot/pydov
class Boring(AbstractDovType):
    """Class representing the DOV data type for boreholes."""

    subtypes = [BoorMethode]

    fields = [
        WfsField(name='pkey_boring', source_field='fiche', datatype='string'),
        WfsField(name='boornummer',
                 source_field='boornummer',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        XmlField(name='mv_mtaw',
                 source_xpath='/boring/oorspronkelijk_maaiveld/waarde',
                 definition='Maaiveldhoogte in mTAW op dag dat de boring '
                 'uitgevoerd werd.',
                 datatype='float'),
        WfsField(name='start_boring_mtaw',
                 source_field='Z_mTAW',
                 datatype='float'),
        WfsField(name='gemeente', source_field='gemeente', datatype='string'),
        XmlField(name='diepte_boring_van',
                 source_xpath='/boring/diepte_van',
                 definition='Startdiepte van de boring (in meter).',
                 datatype='float',
                 notnull=True),
        WfsField(name='diepte_boring_tot',
                 source_field='diepte_tot_m',
                 datatype='float'),
        WfsField(name='datum_aanvang',
                 source_field='datum_aanvang',
                 datatype='date'),
        WfsField(name='uitvoerder',
                 source_field='uitvoerder',
                 datatype='string'),
        XmlField(name='boorgatmeting',
                 source_xpath='/boring/boorgatmeting/uitgevoerd',
                 definition='Is er een boorgatmeting uitgevoerd (ja/nee).',
                 datatype='boolean')
    ]

    pkey_fieldname = 'fiche'

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Boring (borehole), being a URI of the form
            `https://www.dov.vlaanderen.be/data/boring/<id>`.

        """
        super(Boring, self).__init__('boring', pkey)
예제 #2
0
class AbstractBoringInterpretatie(AbstractDovType):
    """Abstract base class for interpretations that are linked to boreholes
    only."""

    fields = [
        WfsField(name='pkey_interpretatie',
                 source_field='Interpretatiefiche',
                 datatype='string'),
        WfsField(name='pkey_boring',
                 source_field='Proeffiche',
                 datatype='string'),
        WfsField(name='betrouwbaarheid_interpretatie',
                 source_field='Betrouwbaarheid',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float')
    ]

    pkey_fieldname = 'Interpretatiefiche'

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Interpretatie (interpretations), being a
            URI of the form
            `https://www.dov.vlaanderen.be/data/interpretatie/<id>`.

        """
        super(AbstractBoringInterpretatie,
              self).__init__('interpretatie', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        instance = cls(
            feature.findtext('./{{{}}}{}'.format(namespace,
                                                 cls.pkey_fieldname)))

        for field in cls.get_fields(source=('wfs', )).values():
            instance.data[field['name']] = cls._parse(
                func=feature.findtext,
                xpath=field['sourcefield'],
                namespace=namespace,
                returntype=field.get('type', None))

        return instance
예제 #3
0
class GrondwaterFilter(AbstractDovType):
    """Class representing the DOV data type for Groundwater screens."""

    subtypes = [Peilmeting]

    fields = [
        WfsField(name='pkey_filter',
                 source_field='filterfiche',
                 datatype='string'),
        WfsField(name='pkey_grondwaterlocatie',
                 source_field='putfiche',
                 datatype='string'),
        WfsField(name='gw_id', source_field='GW_ID', datatype='string'),
        WfsField(name='filternummer',
                 source_field='filternummer',
                 datatype='string'),
        WfsField(name='filtertype',
                 source_field='filtertype',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        WfsField(name='start_grondwaterlocatie_mtaw',
                 source_field='Z_mTAW',
                 datatype='float'),
        XmlField(name='mv_mtaw',
                 source_xpath='/grondwaterlocatie/puntligging/'
                 'oorspronkelijk_maaiveld/waarde',
                 definition='Maaiveldhoogte in mTAW op dag '
                 'dat de put/boring uitgevoerd werd',
                 datatype='float'),
        WfsField(name='gemeente', source_field='gemeente', datatype='string'),
        XmlField(name='meetnet_code',
                 source_xpath='/filter/meetnet',
                 definition='Tot welk meetnet behoort deze filter.',
                 datatype='string',
                 xsd_type=XsdType(xsd_schema=_filterDataCodes_xsd,
                                  typename='MeetnetEnumType')),
        XmlField(name='aquifer_code',
                 source_xpath='/filter/ligging/aquifer',
                 definition='In welke watervoerende laag hangt de filter '
                 '(code).',
                 datatype='string',
                 xsd_type=XsdType(xsd_schema=build_dov_url(
                     'xdov/schema/latest/xsd/kern/interpretatie/'
                     'HydrogeologischeStratigrafieDataCodes.xsd'),
                                  typename='AquiferEnumType')),
        XmlField(name='grondwaterlichaam_code',
                 source_xpath='/filter/ligging/grondwaterlichaam',
                 definition='',
                 datatype='string',
                 xsd_type=XsdType(xsd_schema=_filterDataCodes_xsd,
                                  typename='GrondwaterlichaamEnumType')),
        XmlField(name='regime',
                 source_xpath='/filter/ligging/regime',
                 definition='',
                 datatype='string'),
        WfsField(name='diepte_onderkant_filter',
                 source_field='onderkant_filter_m',
                 datatype='float'),
        WfsField(name='lengte_filter',
                 source_field='lengte_filter_m',
                 datatype='float')
    ]

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Filter (screen), being a URI of the form
            `https://www.dov.vlaanderen.be/data/filter/<id>`.

        """
        super(GrondwaterFilter, self).__init__('filter', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        """Build `GrondwaterFilter` instance from a WFS feature element.

        Parameters
        ----------
        feature : etree.Element
            XML element representing a single record of the WFS layer.
        namespace : str
            Namespace associated with this WFS featuretype.

        Returns
        -------
        filter : GrondwaterFilter
            An instance of this class populated with the data from the WFS
            element.

        """
        gwfilter = cls(
            feature.findtext('./{{{}}}filterfiche'.format(namespace)))

        for field in cls.get_fields(source=('wfs', )).values():
            gwfilter.data[field['name']] = cls._parse(
                func=feature.findtext,
                xpath=field['sourcefield'],
                namespace=namespace,
                returntype=field.get('type', None))

        return gwfilter
예제 #4
0
class AbstractCommonInterpretatie(AbstractDovType):
    """Abstract base class for interpretations that can be linked to
    boreholes or cone penetration tests."""

    fields = [
        WfsField(name='pkey_interpretatie',
                 source_field='Interpretatiefiche',
                 datatype='string'),
        _CustomField(name='pkey_boring',
                     definition='URL die verwijst naar de gegevens van de '
                     'boring waaraan deze informele stratigrafie '
                     'gekoppeld is (indien gekoppeld aan een '
                     'boring).',
                     datatype='string'),
        _CustomField(name='pkey_sondering',
                     definition='URL die verwijst naar de gegevens van de '
                     'sondering waaraan deze informele '
                     'stratigrafie gekoppeld is (indien gekoppeld '
                     'aan een sondering).',
                     datatype='string'),
        WfsField(name='betrouwbaarheid_interpretatie',
                 source_field='Betrouwbaarheid',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float')
    ]

    pkey_fieldname = 'Interpretatiefiche'

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Interpretatie (interpretations), being a
            URI of the form
            `https://www.dov.vlaanderen.be/data/interpretatie/<id>`.

        """
        super(AbstractCommonInterpretatie,
              self).__init__('interpretatie', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        instance = cls(
            feature.findtext('./{{{}}}{}'.format(namespace,
                                                 cls.pkey_fieldname)))

        typeproef = cls._parse(func=feature.findtext,
                               xpath='Type_proef',
                               namespace=namespace,
                               returntype='string')

        if typeproef == 'Boring':
            instance.data['pkey_boring'] = cls._parse(func=feature.findtext,
                                                      xpath='Proeffiche',
                                                      namespace=namespace,
                                                      returntype='string')
            instance.data['pkey_sondering'] = np.nan
        elif typeproef == 'Sondering':
            instance.data['pkey_sondering'] = cls._parse(func=feature.findtext,
                                                         xpath='Proeffiche',
                                                         namespace=namespace,
                                                         returntype='string')
            instance.data['pkey_boring'] = np.nan
        else:
            instance.data['pkey_boring'] = np.nan
            instance.data['pkey_sondering'] = np.nan

        for field in cls.get_fields(source=('wfs', )).values():
            if field['name'] in ['pkey_boring', 'pkey_sondering']:
                continue

            instance.data[field['name']] = cls._parse(
                func=feature.findtext,
                xpath=field['sourcefield'],
                namespace=namespace,
                returntype=field.get('type', None))

        return instance
예제 #5
0
class Grondmonster(AbstractDovType):
    """Class representing the DOV data type for ground samples."""

    subtypes = [Korrelverdeling]

    __grondmonsterDataCodesEnumType = XsdType(
        xsd_schema='https://www.dov.vlaanderen.be/xdov/schema/latest/'
        'xsd/kern/grondmonster/GrondmonsterDataCodes.xsd',
        typename='MonsterEnumType')

    fields = [
        WfsField(name='pkey_grondmonster',
                 source_field='grondmonsterfiche',
                 datatype='string'),
        WfsField(name='naam', source_field='naam', datatype='string'),
        WfsField(name='pkey_boring',
                 source_field='boringfiche',
                 datatype='string'),
        WfsField(name='boornummer',
                 source_field='boornummer',
                 datatype='string'),
        XmlField(
            name='datum',
            source_xpath='/grondmonster/datum_monstername',
            datatype='date',
        ),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        WfsField(name='gemeente', source_field='gemeente', datatype='string'),
        WfsField(name='diepte_van_m',
                 source_field='diepte_van_m',
                 datatype='float'),
        WfsField(name='diepte_tot_m',
                 source_field='diepte_tot_m',
                 datatype='float'),
        WfsField(name='peil_van_mtaw',
                 source_field='peil_van_mTAW',
                 datatype='float'),
        WfsField(name='peil_tot_mtaw',
                 source_field='peil_tot_mTAW',
                 datatype='float'),
        WfsField(name='monstertype',
                 source_field='monstertype',
                 datatype='string'),
        XmlField(name='astm_naam',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="ASTM_NAAM"]/waarde_text',
                 definition='ASTM_naam',
                 datatype='string'),
        XmlField(name='grondsoort_bggg',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="BGGG"]/waarde_text',
                 definition='Grondsoort BGGG',
                 datatype='string'),
        XmlField(name='humusgehalte',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="HUMUSGEHALTE"]/waarde_numeriek',
                 definition='Humusgehalte',
                 datatype='float'),
        XmlField(name='kalkgehalte',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="KALKGEHALTE"]/waarde_numeriek',
                 definition='Kalkgehalte',
                 datatype='float'),
        XmlField(name='uitrolgrens',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="UITROLGRENS"]/waarde_numeriek',
                 definition='Uitrolgrens',
                 datatype='float'),
        XmlField(name='vloeigrens',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="VLOEIGRENS"]/waarde_numeriek',
                 definition='Vloeigrens',
                 datatype='float'),
        XmlField(name='glauconiet',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="GLAUCONIET_TOTAAL"]/waarde_numeriek',
                 definition='Glauconiet totaal',
                 datatype='float'),
        XmlField(name='korrelvolumemassa',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="korrelvolumemassa"]/waarde_numeriek',
                 definition='',
                 datatype='float'),
        XmlField(name='volumemassa',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="volumemassa"]/waarde_numeriek',
                 definition='',
                 datatype='float'),
        XmlField(name='watergehalte',
                 source_xpath='/grondmonster/observatieData/observatie['
                 'parameter="watergehalte"]/waarde_numeriek',
                 definition='',
                 datatype='float')
    ]

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Grondmonster, being a URI of the form
            `https://www.dov.vlaanderen.be/data/grondmonster/<id>`.

        """
        super(Grondmonster, self).__init__('grondmonster', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        """Build `Grondmonster` instance from a WFS feature element.

        Parameters
        ----------
        feature : etree.Element
            XML element representing a single record of the WFS layer.
        namespace : str
            Namespace associated with this WFS featuretype.

        Returns
        -------
        grondmonster : Grondmonster
            An instance of this class populated with the data from the WFS
            element.

        """
        grondmonster = cls(
            feature.findtext('./{{{}}}grondmonsterfiche'.format(namespace)))

        for field in cls.get_fields(source=('wfs', )).values():
            grondmonster.data[field['name']] = cls._parse(
                func=feature.findtext,
                xpath=field['sourcefield'],
                namespace=namespace,
                returntype=field.get('type', None))

        return grondmonster
예제 #6
0
class AbstractBoringInterpretatie(AbstractDovType):
    """Abstract base class for interpretations that are linked to boreholes
    only."""

    fields = [
        WfsField(name='pkey_interpretatie',
                 source_field='Interpretatiefiche',
                 datatype='string'),
        WfsField(name='pkey_boring',
                 source_field='Proeffiche',
                 datatype='string'),
        WfsField(name='betrouwbaarheid_interpretatie',
                 source_field='Betrouwbaarheid',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float')
    ]

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Interpretatie (interpretations), being a
            URI of the form
            `https://www.dov.vlaanderen.be/data/interpretatie/<id>`.

        """
        super(AbstractBoringInterpretatie,
              self).__init__('interpretatie', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        """Build an instance from a WFS feature element.

        Parameters
        ----------
        feature : etree.Element
            XML element representing a single record of the WFS layer.
        namespace : str
            Namespace associated with this WFS featuretype.

        Returns
        -------
        instance of this class
            An instance of this class populated with the data from the WFS
            element.

        """
        instance = cls(
            feature.findtext('./{{{}}}Interpretatiefiche'.format(namespace)))

        for field in cls.get_fields(source=('wfs', )).values():
            instance.data[field['name']] = cls._parse(
                func=feature.findtext,
                xpath=field['sourcefield'],
                namespace=namespace,
                returntype=field.get('type', None))

        return instance
예제 #7
0
class GrondwaterMonster(AbstractDovType):
    """Class representing the DOV data type for Groundwater samples."""

    subtypes = [Observatie]

    fields = [
        WfsField(name='pkey_grondwatermonster',
                 source_field='grondwatermonsterfiche',
                 datatype='string'),
        WfsField(name='grondwatermonsternummer',
                 source_field='grondwatermonsternummer',
                 datatype='string'),
        WfsField(name='pkey_grondwaterlocatie',
                 source_field='grondwaterlocatiefiche',
                 datatype='string'),
        WfsField(name='gw_id', source_field='GW_ID', datatype='string'),
        WfsField(name='pkey_filter',
                 source_field='filterfiche',
                 datatype='string'),
        WfsField(name='filternummer',
                 source_field='filternr',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        WfsField(name='start_grondwaterlocatie_mtaw',
                 source_field='Z_mTAW',
                 datatype='float'),
        WfsField(name='gemeente', source_field='gemeente', datatype='string'),
        WfsField(name='datum_monstername',
                 source_field='datum_monstername',
                 datatype='date'),
    ]

    pkey_fieldname = 'grondwatermonsterfiche'

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the GrondwaterMonster (groundwater sample), being
            a URI of the form
            `https://www.dov.vlaanderen.be/data/watermonster/<id>`.

        """
        super(GrondwaterMonster, self).__init__('watermonster', pkey)
예제 #8
0
파일: grondmonster.py 프로젝트: rebot/pydov
class Grondmonster(AbstractDovType):
    """Class representing the DOV data type for ground samples."""

    subtypes = [Korrelverdeling]

    __grondmonsterDataCodesEnumType = XsdType(
        xsd_schema='https://www.dov.vlaanderen.be/xdov/schema/latest/'
                   'xsd/kern/grondmonster/GrondmonsterDataCodes.xsd',
        typename='MonsterEnumType'
    )

    fields = [
        WfsField(name='pkey_grondmonster',
                 source_field='grondmonsterfiche',
                 datatype='string'),
        WfsField(name='naam',
                 source_field='naam',
                 datatype='string'),
        WfsField(name='pkey_boring',
                 source_field='boringfiche',
                 datatype='string'),
        WfsField(name='boornummer',
                 source_field='boornummer',
                 datatype='string'),
        XmlField(name='datum',
                 source_xpath='/grondmonster/datum_monstername',
                 datatype='date',),
        WfsField(name='x',
                 source_field='X_mL72',
                 datatype='float'),
        WfsField(name='y',
                 source_field='Y_mL72',
                 datatype='float'),
        WfsField(name='gemeente',
                 source_field='gemeente',
                 datatype='string'),
        WfsField(name='diepte_van_m',
                 source_field='diepte_van_m',
                 datatype='float'),
        WfsField(name='diepte_tot_m',
                 source_field='diepte_tot_m',
                 datatype='float'),
        WfsField(name='peil_van_mtaw',
                 source_field='peil_van_mTAW',
                 datatype='float'),
        WfsField(name='peil_tot_mtaw',
                 source_field='peil_tot_mTAW',
                 datatype='float'),
        WfsField(name='monstertype',
                 source_field='monstertype',
                 datatype='string'),
        XmlField(name='astm_naam',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="ASTM_NAAM"]/waarde_text',
                 definition='ASTM_naam',
                 datatype='string'),
        XmlField(name='grondsoort_bggg',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="BGGG"]/waarde_text',
                 definition='Grondsoort BGGG',
                 datatype='string'),
        XmlField(name='humusgehalte',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="HUMUSGEHALTE"]/waarde_numeriek',
                 definition='Humusgehalte',
                 datatype='float'),
        XmlField(name='kalkgehalte',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="KALKGEHALTE"]/waarde_numeriek',
                 definition='Kalkgehalte',
                 datatype='float'),
        XmlField(name='uitrolgrens',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="UITROLGRENS"]/waarde_numeriek',
                 definition='Uitrolgrens',
                 datatype='float'),
        XmlField(name='vloeigrens',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="VLOEIGRENS"]/waarde_numeriek',
                 definition='Vloeigrens',
                 datatype='float'),
        XmlField(name='glauconiet',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="GLAUCONIET_TOTAAL"]/waarde_numeriek',
                 definition='Glauconiet totaal',
                 datatype='float'),
        XmlField(name='korrelvolumemassa',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="KORRELVOLUMEMASSA"]/waarde_numeriek',
                 definition='',
                 datatype='float'),
        XmlField(name='volumemassa',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="VOLUMEMASSA"]/waarde_numeriek',
                 definition='',
                 datatype='float'),
        XmlField(name='watergehalte',
                 source_xpath='/grondmonster/observatieData/observatie['
                              'parameter="WATERGEHALTE"]/waarde_numeriek',
                 definition='',
                 datatype='float')
    ]

    pkey_fieldname = 'grondmonsterfiche'

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Grondmonster, being a URI of the form
            `https://www.dov.vlaanderen.be/data/grondmonster/<id>`.

        """
        super(Grondmonster, self).__init__('grondmonster', pkey)
예제 #9
0
class GrondwaterFilter(AbstractDovType):
    """Class representing the DOV data type for Groundwater screens."""

    subtypes = [Peilmeting]

    fields = [
        WfsField(name='pkey_filter',
                 source_field='filterfiche',
                 datatype='string'),
        WfsField(name='pkey_grondwaterlocatie',
                 source_field='putfiche',
                 datatype='string'),
        WfsField(name='gw_id', source_field='GW_ID', datatype='string'),
        WfsField(name='filternummer',
                 source_field='filternummer',
                 datatype='string'),
        WfsField(name='filtertype',
                 source_field='filtertype',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        WfsField(name='start_grondwaterlocatie_mtaw',
                 source_field='Z_mTAW',
                 datatype='float'),
        XmlField(name='mv_mtaw',
                 source_xpath='/grondwaterlocatie/puntligging/'
                 'oorspronkelijk_maaiveld/waarde',
                 definition='Maaiveldhoogte in mTAW op dag '
                 'dat de put/boring uitgevoerd werd',
                 datatype='float'),
        WfsField(name='gemeente', source_field='gemeente', datatype='string'),
        XmlField(name='meetnet_code',
                 source_xpath='/filter/meetnet',
                 definition='Tot welk meetnet behoort deze filter.',
                 datatype='string',
                 xsd_type=XsdType(xsd_schema=_filterDataCodes_xsd,
                                  typename='MeetnetEnumType')),
        XmlField(name='aquifer_code',
                 source_xpath='/filter/ligging/aquifer',
                 definition='In welke watervoerende laag hangt de filter '
                 '(code).',
                 datatype='string',
                 xsd_type=XsdType(xsd_schema=build_dov_url(
                     'xdov/schema/latest/xsd/kern/interpretatie/'
                     'HydrogeologischeStratigrafieDataCodes.xsd'),
                                  typename='AquiferEnumType')),
        XmlField(name='grondwaterlichaam_code',
                 source_xpath='/filter/ligging/grondwaterlichaam',
                 definition='',
                 datatype='string',
                 xsd_type=XsdType(xsd_schema=_filterDataCodes_xsd,
                                  typename='GrondwaterlichaamEnumType')),
        XmlField(name='regime',
                 source_xpath='/filter/ligging/regime',
                 definition='',
                 datatype='string'),
        WfsField(name='diepte_onderkant_filter',
                 source_field='onderkant_filter_m',
                 datatype='float'),
        WfsField(name='lengte_filter',
                 source_field='lengte_filter_m',
                 datatype='float')
    ]

    pkey_fieldname = 'filterfiche'

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Filter (screen), being a URI of the form
            `https://www.dov.vlaanderen.be/data/filter/<id>`.

        """
        super(GrondwaterFilter, self).__init__('filter', pkey)
예제 #10
0
class Boring(AbstractDovType):
    """Class representing the DOV data type for boreholes."""

    subtypes = [BoorMethode]

    fields = [
        WfsField(name='pkey_boring', source_field='fiche', datatype='string'),
        WfsField(name='boornummer',
                 source_field='boornummer',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        XmlField(name='mv_mtaw',
                 source_xpath='/boring/oorspronkelijk_maaiveld/waarde',
                 definition='Maaiveldhoogte in mTAW op dag dat de boring '
                 'uitgevoerd werd.',
                 datatype='float'),
        WfsField(name='start_boring_mtaw',
                 source_field='Z_mTAW',
                 datatype='float'),
        WfsField(name='gemeente', source_field='gemeente', datatype='string'),
        XmlField(name='diepte_boring_van',
                 source_xpath='/boring/diepte_van',
                 definition='Startdiepte van de boring (in meter).',
                 datatype='float',
                 notnull=True),
        WfsField(name='diepte_boring_tot',
                 source_field='diepte_tot_m',
                 datatype='float'),
        WfsField(name='datum_aanvang',
                 source_field='datum_aanvang',
                 datatype='date'),
        WfsField(name='uitvoerder',
                 source_field='uitvoerder',
                 datatype='string'),
        XmlField(name='boorgatmeting',
                 source_xpath='/boring/boorgatmeting/uitgevoerd',
                 definition='Is er een boorgatmeting uitgevoerd (ja/nee).',
                 datatype='boolean')
    ]

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Boring (borehole), being a URI of the form
            `https://www.dov.vlaanderen.be/data/boring/<id>`.

        """
        super(Boring, self).__init__('boring', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        b = cls(feature.findtext('./{{{}}}fiche'.format(namespace)))

        for field in cls.get_fields(source=('wfs', )).values():
            b.data[field['name']] = cls._parse(func=feature.findtext,
                                               xpath=field['sourcefield'],
                                               namespace=namespace,
                                               returntype=field.get(
                                                   'type', None))

        return b
예제 #11
0
class GrondwaterMonster(AbstractDovType):
    """Class representing the DOV data type for Groundwater samples."""

    subtypes = [Observatie]

    fields = [
        WfsField(name='pkey_grondwatermonster',
                 source_field='grondwatermonsterfiche',
                 datatype='string'),
        WfsField(name='grondwatermonsternummer',
                 source_field='grondwatermonsternummer',
                 datatype='string'),
        WfsField(name='pkey_grondwaterlocatie',
                 source_field='grondwaterlocatiefiche',
                 datatype='string'),
        WfsField(name='gw_id', source_field='GW_ID', datatype='string'),
        WfsField(name='pkey_filter', source_field='filterfiche',
                 datatype='string'),
        WfsField(name='filternummer', source_field='filternr',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        WfsField(name='start_grondwaterlocatie_mtaw', source_field='Z_mTAW',
                 datatype='float'),
        WfsField(name='gemeente', source_field='gemeente', datatype='string'),
        WfsField(name='datum_monstername', source_field='datum_monstername',
                 datatype='date'),
    ]

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the GrondwaterMonster (groundwater sample), being
            a URI of the form
            `https://www.dov.vlaanderen.be/data/watermonster/<id>`.

        """
        super(GrondwaterMonster, self).__init__('watermonster', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        """Build `GrondwaterMonster` instance from a WFS feature element.

        Parameters
        ----------
        feature : etree.Element
            XML element representing a single record of the WFS layer.
        namespace : str
            Namespace associated with this WFS featuretype.

        Returns
        -------
        gwmonster : GrondwaterMonster
            An instance of this class populated with the data from the WFS
            element.

        """
        gwmonster = cls(
            feature.findtext(
                './{{{}}}grondwatermonsterfiche'.format(namespace)))

        for field in cls.get_fields(source=('wfs',)).values():
            gwmonster.data[field['name']] = cls._parse(
                func=feature.findtext,
                xpath=field['sourcefield'],
                namespace=namespace,
                returntype=field.get('type', None)
            )

        return gwmonster
예제 #12
0
class Sondering(AbstractDovType):
    """Class representing the DOV data type for CPT measurements."""

    subtypes = [Meetdata]

    fields = [
        WfsField(name='pkey_sondering',
                 source_field='fiche',
                 datatype='string'),
        WfsField(name='sondeernummer',
                 source_field='sondeernummer',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        WfsField(name='start_sondering_mtaw',
                 source_field='Z_mTAW',
                 datatype='float'),
        WfsField(name='diepte_sondering_van',
                 source_field='diepte_van_m',
                 datatype='float'),
        WfsField(name='diepte_sondering_tot',
                 source_field='diepte_tot_m',
                 datatype='float'),
        WfsField(name='datum_aanvang',
                 source_field='datum_aanvang',
                 datatype='date'),
        WfsField(name='uitvoerder',
                 source_field='uitvoerder',
                 datatype='string'),
        WfsField(name='sondeermethode',
                 source_field='sondeermethode',
                 datatype='string'),
        WfsField(name='apparaat',
                 source_field='apparaat_type',
                 datatype='string'),
        XmlField(name='datum_gw_meting',
                 source_xpath='/sondering/visueelonderzoek/'
                 'datumtijd_waarneming_grondwaterstand',
                 definition='Datum en tijdstip van waarneming van de '
                 'grondwaterstand.',
                 datatype='datetime'),
        XmlField(name='diepte_gw_m',
                 source_xpath='/sondering/visueelonderzoek/grondwaterstand',
                 definition='Diepte water in meter ten opzicht van het '
                 'aanvangspeil.',
                 datatype='float')
    ]

    pkey_fieldname = 'fiche'

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Sondering (CPT measurement), being a URI of
            the form `https://www.dov.vlaanderen.be/data/sondering/<id>`.

        """
        super(Sondering, self).__init__('sondering', pkey)
예제 #13
0
class Sondering(AbstractDovType):
    """Class representing the DOV data type for CPT measurements."""

    subtypes = [Meetdata]

    fields = [
        WfsField(name='pkey_sondering',
                 source_field='fiche',
                 datatype='string'),
        WfsField(name='sondeernummer',
                 source_field='sondeernummer',
                 datatype='string'),
        WfsField(name='x', source_field='X_mL72', datatype='float'),
        WfsField(name='y', source_field='Y_mL72', datatype='float'),
        WfsField(name='start_sondering_mtaw',
                 source_field='Z_mTAW',
                 datatype='float'),
        WfsField(name='diepte_sondering_van',
                 source_field='diepte_van_m',
                 datatype='float'),
        WfsField(name='diepte_sondering_tot',
                 source_field='diepte_tot_m',
                 datatype='float'),
        WfsField(name='datum_aanvang',
                 source_field='datum_aanvang',
                 datatype='date'),
        WfsField(name='uitvoerder',
                 source_field='uitvoerder',
                 datatype='string'),
        WfsField(name='sondeermethode',
                 source_field='sondeermethode',
                 datatype='string'),
        WfsField(name='apparaat',
                 source_field='apparaat_type',
                 datatype='string'),
        XmlField(name='datum_gw_meting',
                 source_xpath='/sondering/visueelonderzoek/'
                 'datumtijd_waarneming_grondwaterstand',
                 definition='Datum en tijdstip van waarneming van de '
                 'grondwaterstand.',
                 datatype='datetime'),
        XmlField(name='diepte_gw_m',
                 source_xpath='/sondering/visueelonderzoek/grondwaterstand',
                 definition='Diepte water in meter ten opzicht van het '
                 'aanvangspeil.',
                 datatype='float')
    ]

    def __init__(self, pkey):
        """Initialisation.

        Parameters
        ----------
        pkey : str
            Permanent key of the Sondering (CPT measurement), being a URI of
            the form `https://www.dov.vlaanderen.be/data/sondering/<id>`.

        """
        super(Sondering, self).__init__('sondering', pkey)

    @classmethod
    def from_wfs_element(cls, feature, namespace):
        s = cls(feature.findtext('./{{{}}}fiche'.format(namespace)))

        for field in cls.get_fields(source=('wfs', )).values():
            s.data[field['name']] = cls._parse(func=feature.findtext,
                                               xpath=field['sourcefield'],
                                               namespace=namespace,
                                               returntype=field.get(
                                                   'type', None))

        return s