Bug report #15600

Selecting features feature in spatial views and virtual layers leads to wrong results

Added by Gerhard Spieles about 8 years ago. Updated almost 6 years ago.

Status:Open
Priority:High
Assignee:Hugo Mercier
Category:Vectors
Affected QGIS version:3.5(master) Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23523

Description

Select features in spatialite views higlights wrong objects

test.zip (464 KB) Gerhard Spieles, 2016-09-21 02:15 PM

testviewspatialite_qgis3_5_56.zip (441 KB) Gerhard Spieles, 2019-01-01 04:35 PM


Related issues

Related to QGIS Application - Bug report #14232: select features in a spatialite view leads to wrong_results Closed 2016-02-04
Related to QGIS Application - Bug report #15709: bad match of valeurs with virtual layer Closed 2016-10-14
Related to QGIS Application - Bug report #18973: Wrong identification of feature in a View Open 2018-05-17

History

#1 Updated by R. R. about 8 years ago

See also: #15134 (Virtual Layer - Selecting multipart features fails)

Perhaps these issues are related, since virtual layers are based on SpatiaLite.

#2 Updated by Giovanni Manghi over 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#3 Updated by Giovanni Manghi about 7 years ago

  • Regression? changed from No to Yes
  • Priority changed from Normal to High
  • Affected QGIS version changed from 2.14.5 to 2.18.13

Worked as expected for SL views (virtual layer untested as they were not available) until 2.8.*

#4 Updated by Giovanni Manghi about 7 years ago

  • Subject changed from Select feature in spatial views leads to wrong results to Selecting features feature in spatial views and virtual layers leads to wrong results

#5 Updated by Vincent Dionne about 7 years ago

The same problem is present in 2.18.13 when adding a spatialite layer through DB MANAGER -SQL Query.

Easy to replicate: DB Manager => SQLITE => SQL window => Select * from your_layer => add layer.

Feature selection will be wrong.

#6 Updated by Jürgen Fischer about 7 years ago

  • Related to Bug report #14232: select features in a spatialite view leads to wrong_results added

#7 Updated by Jürgen Fischer almost 7 years ago

#8 Updated by Gerhard Spieles over 6 years ago

Issue is still present in 3.1.0-3 (see Mail Paolo Cavallini, QGIS tickets)

#9 Updated by Giovanni Manghi over 6 years ago

  • Affected QGIS version changed from 2.18.13 to 3.1(master)
  • Operating System deleted (win)

#10 Updated by Leon van der Meulen over 6 years ago

Problem still persists in 3 as well with PostGIS layers. Ordinary file based layers are ok though

#11 Updated by Dominique Lyszczarz over 6 years ago

Confirmed with a Geopackage spatial view. Note it also affect manual label positioning with xy position stored in auxiliary layer : trying to move a label with the dedicated tool performs the shift for another feature's label.

#12 Updated by Hugo Mercier about 6 years ago

#13 Updated by Hugo Mercier about 6 years ago

  • Assignee set to Hugo Mercier

I see several issues in the provided project:
- virtual layers: selection works fine, but the identification tool identifies all the object
- spatialite views: selection selects the wrong feature, identification tool seems ok

#14 Updated by Paolo Cavallini almost 6 years ago

Could you please check again on current release and update the affected version if still valid?
Thanks.

#15 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Open to Feedback

Paolo Cavallini wrote:

Could you please check again on current release and update the affected version if still valid?
Thanks.

Please change status to "feedback" when needed.

#16 Updated by Gerhard Spieles almost 6 years ago

Hello,
tested issue with 3.5master, Rel 56.
To exclude faults, i have created a complete new project in 3.5 with a newly created spatialite database and layers via QGIS. Testproject and database are attached (zip).

Virtual Layers seems to be ok!.

Spatialite views leads to the same wrong results in selecting objects.

The issue seems for me to depend in the interpretation/handling of the "ROWID" in QGIS.

In the sample data, I created to views. One with the "ROWID" from the geometrielayer(Parent), one without.
The layer (view) with the "ROWID" shows:
-undefined selection behaviour for objects
-in objectcount = 0,
-open the the attribute table, 100 filtered Rows are shown. Really, the layer has 256 rows.
-When you go to the layer in the layers panel, right click, filter and define a filter "ROWID < 1000000", the objectcount shows 256 rows and the attrubute table shows all the 256 rows. Selecton behaviour is further undefined.

The layer (view) without "ROWID" shows:
-all objects are selected, even only one oject was clicked.
-in objectcount 0
-in attribute table only one filtered row. Setting a filter via layers panel like "ROWID < 1000000" brings no change.

#17 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Feedback to Open

Also available in: Atom PDF