Problem with spatial selection on Spatialite spatial view in QGIS

119 views
Skip to first unread message

Richard Males

unread,
Jan 2, 2016, 2:05:11 PM1/2/16
to SpatiaLite Users
Starting by posting here, will cross-post to QGIS forum if no answer forthcoming.  Not sure where the problem lies, or even how to tell.

spatialite_gui 1.8.0 devel
QGIS 2.12.2-Lyon

For work I am doing in developing a model of coastal flooding, I use spatialite as the underlying data store for the location and attributes of structures in a coastal region.

In my spatialite database, I have a table with geometry (Assets), and a related table with attributes (StructureAssets) but no geometry.   I make a spatial join via the query/view composer, joining the geometry and attributes into a spatial view.   I can use this view as a data source in QGIS, it plots perfectly.   However, when I attempt to select by a rectangle on the view, the selected points are all over the place, not in the drawn rectangle.  The first image is based on the Assets table, selection by rectangle.   The second image is based on the view, selection by a similar rectangle.   If I export the view as a shapefile, then selection on the shape file based on the view is fine.  When I create a table in spatialite from the view, and import that table into QGIS, it shows the same selection behavior as the view, i.e. no good.






Any ideas or thoughts for further testing will be welcome.  
Thanks in advance.

Dick
Auto Generated Inline Image 1
Auto Generated Inline Image 2

John Bryant

unread,
Jan 8, 2017, 9:04:20 PM1/8/17
to SpatiaLite Users
Hi Richard, did you find any resolution to this problem? I just discovered it this morning.

Still occurs in 2.16.3, I will try 2.18 and see if it's resolved there. I can't find any issues on the QGIS website. The attached zip file contains a minimal example of the issue in action.

Thanks
John
qgis_spatialite_bug_test.zip

mj10777

unread,
Jan 8, 2017, 11:27:03 PM1/8/17
to SpatiaLite Users


On Monday, 9 January 2017 03:04:20 UTC+1, John Bryant wrote:
Hi Richard, did you find any resolution to this problem? I just discovered it this morning.

Still occurs in 2.16.3, I will try 2.18 and see if it's resolved there. I can't find any issues on the QGIS website. The attached zip file contains a minimal example of the issue in action.
With QGIS versions 2.10, 2.16 (both with gdal 1.11.2) and the the present 2.18, I can load and zoom without a problem
- also using you project, it works correctly (i.e. in the same manor) for both the Shape-File and Database

The given sample from 2016-01-03 contained no sample Data and thus could not be tested.

Note: the Database contains only a SpatialTable and not a SpatialView

Mark

Micha Silver

unread,
Jan 13, 2017, 8:54:58 AM1/13/17
to spatiali...@googlegroups.com
I can verify (QGIS 2.18 on Mint 18) that when I try to select from the filtered set of points (the DB set) always the first points are selected, regardless of where I draw the selection rectangle.


------ Original Message ------ Subject: [SpatiaLite-Users] Re: Problem with spatial selection on Spatialite spatial view in QGIS Date: Sun, 8 Jan 2017 20:27:02 -0800 (PST) To: Spatialite Users From: 'Mj10777' Via Spatialite Users
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To post to this group, send email to spatiali...@googlegroups.com.
Visit this group at https://groups.google.com/group/spatialite-users.
For more options, visit https://groups.google.com/d/optout.

John Bryant

unread,
Jan 13, 2017, 5:59:52 PM1/13/17
to spatiali...@googlegroups.com
Yep, that's the problem. I have filed an issue with the QGIS project, and the problem is confirmed to occur in older versions as well. Hopefully it can be fixed...

Cheers
John


To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-users+unsubscribe@googlegroups.com.

To post to this group, send email to spatialite-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "SpatiaLite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spatialite-users/TIghkhCi1bU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spatialite-users+unsubscribe@googlegroups.com.
To post to this group, send email to spatialite-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages