Bug report #15709
bad match of valeurs with virtual layer
|Affected QGIS version:||2.16.3||Regression?:||No|
|Operating System:||Windows 7||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||23632|
The values no match in the table of virtual layer with the source layer.
The difference is visible in:
- the display table
- on Identify Features tool with a specific entity (not on show all)
The labelling display is ok
see with attached files
Fix virtual layer FilterRect handling when no uid is defined (fixes #15709)
When no uid if defined, features returned have an id defined by an
autoincremented integer. So we cannot use a SQL filter here because it
would return a subset of features and then an autoincremented id that
does not correspond to ids without filters.
So in this case, all the features are requested and the rectangle
intersection is done by the provider, not by SQLite.
#8 Updated by Hugo Mercier about 5 years ago
It is due to the virtual layer that does not have a unique id column defined.
In this case, the "id" will be an incremented integer for each row. The problem is when the identify tool is used, only one row is returned and the resulting id is then 1.
There is no easy way to automate the generation of a unique id for each row. I'm wondering if the right fix would be to prevent the identify tool to be used on layers without unique id.