Bug report #5264
Spatialite Provider / fTools Select by Location does not find intersections
|Affected QGIS version:||master||Regression?:|
|Operating System:||all||Easy fix?:|
|Pull Request or Patch supplied:||No||Resolution:||fixed|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||14995|
fTools 'Select by Location' tool does not find intersecting geometry when using a Spatialite Layer.
Tested working fine with ESRI Shapefile and MYSQL layers.
#3 Updated by Sandro Furieri about 8 years ago
Just tested on pure SpatiaLite:
SELECT pg.pkuid, pt.pkuid
FROM Polygons AS pg, points AS pt
WHERE ST_Intersects(pg.geometry, pt.geometry) = 1;
the above query works nicely on behalf of the DB file
included in Spatialite_fTools_Bug.zip
Anyway, as far as I can see, fTools doesn't uses the
internal Spatial capabilities supplied by SpatiaLite;
it's a Python process attempting to retrieve "raw"
features supplied by the underlying QGIS data provider,
then calling GEOS so to perform actual spatial processing
(exactly the same as internally managed by SpatiaLite's
own Spatial SQL functions).
So standing things, I can only suppose that:
a) fTools apply some wrong assumption about geometries/features
returned by the SpatiaLite data provider
b) alternatively, the data provider itself returns badly
formatted features (this seeming less probable, because only
fTools apparently seems to get problems when processing SpatiaLite
data: AFAIK any other QGIS module works exactly as expected)
I'm not a Python developer and fTools code is rather complex:
sorry, but I'm completely unable to go in further depth.
Anyway I hope that the above considerations could be useful
for some other developer interested in this topic.