Bug report #20031
The only layer contained in a singlelayer GPKG / SQLite / FileGDB is incorrectly added to the map without "|layername=" in some circumstances
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Even Rouault | ||
Category: | Data Provider/OGR | ||
Affected QGIS version: | 3.3(master) | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 27853 |
Description
When there is only 1 layer in a GPKG / SQLite / FileGDB container file and you drag and drop the file in the map or you use the Data Source Manager / Vector dialog window to add the layer to the map, then the layer is automatically (without the "Select Vector Layers to Add..." dialog window appearing) added only with an incorrect source like
filepath\filename.gpkg
instead of a more correct
filepath\filename.gpkg|layername=name_of_the_layer
This could lead to annoying layers mixing ups / shuffling (see the already fixed #18081 and #19885).
On the contrary, when the layer in a single layer gpkg/sqlite/filegdb container is added to the map through the Browser panel instead, its source is in the correct form "filepath\filename.gpkg|layername=name_of_the_layer".
Originally reported in #19938#note-6
Related issues
Associated revisions
QgisApp::addVectorLayer(): add |layername= to OGR datasets (fixes #20031)
Do it also in case of datasets that have a single layer, in case they might
later be edited to have more layers
(except for a few drivers known to be always single layer)
History
#1 Updated by Andrea Giudiceandrea about 6 years ago
- Related to Bug report #18081: GDB recognition mixup added
#2 Updated by Andrea Giudiceandrea about 6 years ago
- Related to Bug report #19885: Using the Browser panel layers are added by layerid added
#3 Updated by Even Rouault about 6 years ago
- Assignee set to Even Rouault
#4 Updated by Even Rouault about 6 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|119cd8ace97d9dfef6c6d5f5fb3aca727a6cc31f.