WhereGroup / spatial_filter

A QGIS plugin to spatially filter project layers for speed and efficiency
GNU General Public License v3.0
7 stars 2 forks source link

Add WFS support #15

Open kannes opened 1 year ago

kannes commented 1 year ago

@pathmapper and I were trying spatial queries on WFS layers and it might "just work". Not sure if every WFS will allow for it but it might be worth trying.

Example: On https://www.wfs.nrw.de/geobasis/wfs_nw_dvg -> dvg:nw_dvg2_krs the filter SELECT * FROM nw_dvg1_krs WHERE ST_Intersects(msGeometry, ST_GeometryFromText('POINT(455600 5720000)')) works.

msGeometry is the name of the geometry column. We looked it up manually on https://www.wfs.nrw.de/geobasis/wfs_nw_dvg?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAMES=dvg:nw_dvg2_krs&TYPENAME=dvg:nw_dvg2_krs

It might be ugly/hard to get this via PyQGIS as layer.dataProvider().uri().geometryColumn() returns an empty string :(

Being able to filter (slow and quickly overloaded) WFS servers would be great!

kannes commented 1 year ago

The storage type is 'OGC WFS (Web Feature Service)'

OGC API Features would be useful too.

kannes commented 11 months ago

We need to check if the filter actually results in a filtering WFS query (server provides filtered data) or if it is just client-side filtering (full data (in bbox) is downloaded).

Does it work? Does it work for WFS1, WFS2 and OAPIF?