[Qgis-user] How to filter shape or oracle layer

Andrea Giudiceandrea andreaerdna at libero.it
Thu Jun 10 12:25:55 PDT 2021


Dario C wrote
> this is the error message:

The error confirms that your layer provider doesn't support the function
used in your expression.
Your expression works for a memory layer, instead.

AFAIK you couldn't directly perform a spatial filtering for an ESRI
Shapefile layer. I don't know if it is possible for an Oracle layer.


Anyway you could create a virtual layer based on an SQL query like:


select a.* from 'your_layer_name' a, 'your_filter_layer' b
where b."ID" = '2' and st_contains(b.geometry, a.geometry)


replacing your_layer_name and your_filter_layer with the name of your
layers.

The query presumes that the geometry columns of the two layer are called
'geometry': if not, change them accordingly.

Hope someone else could share light on how the oracle provider works, and if
it is possible to directly use a spatial filter for Shapefile or Oracle
layers.

Regards.

Andrea



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html


More information about the Qgis-user mailing list