Geonovum / ogc-api-testbed

OGC API Testbed Template - Stable
https://apitestbed.geonovum.nl
GNU General Public License v3.0
4 stars 4 forks source link

Problem with WFS in Pygeoapi #46

Closed PB-GNM closed 1 year ago

PB-GNM commented 3 years ago

I have tried to use the WFS below as input, but it does not seem te work.

https://geodata.nationaalgeoregister.nl/su-vector/wfs?request=GetFeature&version=2.0.0&typeNames=su-vector:SU.VectorStatisticalUnit&filter=%3CFilter+xmlns=%22http://www.opengis.net/ogc%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Etessellation_localid%3C/PropertyName%3E%3CLiteral%3Egemeente.2017%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E

It gives an error on: https://apisandbox.geonovum.nl/pygeoapi_SU/collections/StatisticalUnits_Gemeente_2017/items?f=html

Does somebody have a suggestion what might be wrong?

PB-GNM commented 3 years ago

The GML output of the WFS request has been put into a separate GML file and added to the list of collections. https://apisandbox.geonovum.nl/pygeoapi_SU/collections/StatisticalUnits_Gemeente_2017_GML gives the same error.

justb4 commented 3 years ago

@PB-GNM @thijsbrentjens I think the problem is that the GML file is based on an (INSPIRE) GML Application Schema (SU). The pygeoapi local.config.yml now uses the 'GML' Driver for this Collection. for GML Application Schema there is an GMLAS Driver. You may try that, though there may still be interworking issues.

An alternative is to download the dataset as a GeoJSON file using the WMS outputFormat option:

https://geodata.nationaalgeoregister.nl/su-vector/wfs?request=GetFeature&version=2.0.0&typeNames=su-vector:SU.VectorStatisticalUnit&filter=%3CFilter+xmlns=%22http://www.opengis.net/ogc%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Etessellation_localid%3C/PropertyName%3E%3CLiteral%3Egemeente.2017%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E&outputFormat=application/json

PB-GNM commented 2 years ago

How do I tell Pygeoapi to use this GMLAS Driver?

Unfortunately &outputFormat=application/json is not working either: https://apisandbox.geonovum.nl/pygeoapi_SU/collections/StatisticalUnits_Gemeente_2017/items?f=json

justb4 commented 1 year ago

@PB-GNM See #50 . I've just fixed the WFS connector with OGR in both Sandbox and original as I was preparing data for the Tender. Also @GeoSander.

Renamed a bit but https://apisandbox.geonovum.nl/pygeoapi_SU/collections/StatisticalUnits_Gemeente_2016_WFS/items?f=json is working. Had to change the config to have OGR Driver think the endpoint is GeoJSON. See comments in #50.

Now all SU testdata (GPKG and WFS) is avaiblable in https://apitestbed.geonovum.nl/pygeoapi/collections?f=html and Sandbox https://apisandbox.geonovum.nl/ (multiple pygeoapi instances).

justb4 commented 1 year ago

So think we can close.