[Qgis-user] FYI: pitfall using spatialite intersects() etc.

Kai Borgolte Kai.Borgolte at gmx.de
Mon Oct 1 01:45:44 PDT 2018


Hi,

as regular user of PostGIS I was baffled that a virtual layer containing

WHERE st_intersects(t2.geometry, t1.geometry)

gave seemingly wrong results. Reading the docs:

"The return type is Integer, with a return value of 1 for TRUE, 0 for
FALSE, and –1 for UNKNOWN corresponding to a function invocation on NULL
arguments"

So UNKNOWN -> -1 -> True will join null geometries with each other
geometry. There is probably not much QGIS can do about this. Changed the
query in

WHERE st_intersects(t2.geometry, t1.geometry) = 1
-- 
Kai Borgolte, Bonn


More information about the Qgis-user mailing list