Bug report #5264
Spatialite Provider / fTools Select by Location does not find intersections
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | - | ||
Category: | Processing/QGIS | ||
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 |
Description
fTools 'Select by Location' tool does not find intersecting geometry when using a Spatialite Layer.
Tested working fine with ESRI Shapefile and MYSQL layers.
Associated revisions
SpatiaLite support in Select by Location tool (fix #5264)
History
#1 Updated by Liam Veitch over 12 years ago
- File Spatialite_fTools_Bug.zip added
I've uploaded a project for others to test.
#2 Updated by Alexander Bruy over 12 years ago
- OS version deleted (
XP) - Priority changed from Normal to High
- Target version changed from Version 1.7.4 to Version 1.8.0
- Operating System changed from Windows to all
Seems this is common problem for all fTools and SpatiaLite layers. See also #4571
#3 Updated by Sandro Furieri over 12 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;
-----------
1|3
1|6
2|4
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.
#4 Updated by Giovanni Manghi over 12 years ago
see also #4571
#5 Updated by Alexander Bruy over 12 years ago
- Status changed from Open to Closed
Fixed in changeset 0b8e1130f1176f20b4d1c8de9c320da6e24b829e.
#6 Updated by Alexander Bruy over 12 years ago
- Resolution set to fixed
#7 Updated by Alexander Bruy over 12 years ago
BTW, this tool duplicates SpatialQuery plugin functionality and probably should be removed
#8 Updated by Giovanni Manghi over 7 years ago
The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.