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

Add data and config to pygeoapi for CRS and INSPIRE support #50

Open
justb4 opened this issue Mar 10, 2023 · 1 comment
Open

Add data and config to pygeoapi for CRS and INSPIRE support #50

justb4 opened this issue Mar 10, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request pygeoapi issues for pygeoapi

Comments

@justb4
Copy link
Contributor

justb4 commented Mar 10, 2023

Adding GPKG and remote PDOK WFS and firx from Sandbox instance.

@justb4 justb4 added the enhancement New feature or request label Mar 10, 2023
@justb4 justb4 self-assigned this Mar 10, 2023
@justb4
Copy link
Contributor Author

justb4 commented Mar 10, 2023

In the Sandbox the Feature Provider to get SU data from PDOK SU INSPIRE Harmonized WFS was not configured right. The configuration always requires a root WFS URL, not a "GetFeature" request, nor any other output than GML.

In order to fetch from a WFS backend in GeoSON AND to filter "sublayers" like only "gemeenten 2016" one can configure an OGR Driver of type "GeoJSON". This driver accepts both a file or a remote URL. Probably less efficient but one can also apply filtering in the WFS request. The modified config will have like:

    StatisticalUnits_Gemeente_2017_WFS:
        type: collection
        title: StatisticalUnits_Gemeente_2017_WFS
        description: In deze dataset zijn de begrenzingen opgenomen van Nederlandse Gemeenten uit 2017. De gegevens in de dataset zijn conform INSPIRE geharmoniseerd en uit PDOK su-vector WFS.
        keywords:
            - statistiek
            - Gemeenten
        links:
            - type: text/html
              rel: describedby
              title: Metadata as HTML
              href: https://www.nationaalgeoregister.nl/geonetwork/srv/dut/catalog.search#/metadata/10d1153e-778f-4995-9b6c-7c69b196cccb
              hreflang: nl
.
.
.
            - type: application/gml+xml
              rel: enclosure
              title: Download volledige dataset als GML
              href: https://geodata.nationaalgeoregister.nl/su-vector/wfs?request=GetFeature&version=2.0.0&typeNames=su-vector:SU.VectorStatisticalUnit&CQL_FILTER=tessellation_localid=%27gemeente.2017%27
              hreflang: nl
        extents:
            spatial:
                bbox: [3.10, 50.50, 7.60, 53.80]
                crs: http://www.opengis.net/def/crs/OGC/1.3/EPSG:4326
            temporal:
                begin: 2017-01-01T00:00:01Z  # start datetime in RFC3339                                                                                             f
                end: 2017-12-31T23:59:59Z  # end datetime in RFC3339
        providers:
            - type: feature
              name: OGR
              data:
                  source_type: GeoJSON
                  source: https://geodata.nationaalgeoregister.nl/su-vector/wfs?request=GetFeature&version=2.0.0&typeNames=su-vector:SU.VectorStatisticalUnit&CQL_FILTER=tessellation_localid=%27gemeente.2017%27&outputFormat=application/json
                  source_srs: EPSG:4326
                  target_srs: EPSG:4326
              gdal_ogr_options:
                EMPTY_AS_NULL: NO
                GDAL_CACHEMAX: 64
                CPL_DEBUG: NO
              id_field: localid
              title_field: geographicalname
              layer: OGRGeoJSON

Especially the last segment here: using source_type: GeoJSON, as source a filtered WFS request (using CQL here but could also be standard WFS Property Filter), and outputFormat=application/json. For OGR this is now a regular GeoJSON endpoint. The other "trick", as there is no Layer, is to set: layer: OGRGeoJSON. GeoServer will already transsform from EPSG:4258 (ETRS89) to EPSG:4326. But we may apply crs with pygeoapi later.

justb4 added a commit that referenced this issue Mar 13, 2023
@justb4 justb4 added the pygeoapi issues for pygeoapi label Mar 14, 2023
justb4 added a commit that referenced this issue Mar 17, 2023
justb4 added a commit that referenced this issue Mar 17, 2023
justb4 added a commit that referenced this issue Mar 20, 2023
justb4 added a commit that referenced this issue Mar 20, 2023
justb4 added a commit that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pygeoapi issues for pygeoapi
Projects
None yet
Development

No branches or pull requests

1 participant