Bug report #20050

Updated by Andrea Giudiceandrea over 5 years ago

*1)* When *a geopackage file contains only 1 raster layer* and you drag and drop the GPKG file into the map or you use the "Data Source Manager / Raster" dialog window to add the layer to the map, then:

the layer is automatically added (without the "Select Raster Layers to Add..." dialog window appearing) only like
<pre>
filepath\filename.gpkg
</pre>
instead of
<pre>
GPKG:filepath/filename.gpkg:raster_layer_name
</pre>

See Issue #20031 and PR https://github.com/qgis/QGIS/pull/8127 about the a similar issue fixed for vector layers import.

Moreover, the raster layer name is set to "filename" instead of a proper name like "raster_layer_name" or "filename raster_layer_name" (as for vector layers).

*2)* When *a geopackage file contains more then 1 raster layer* and you drag and drop the GPKG file into the map or you use the "Data Source Manager / Raster" dialog window to add the layer to the map, then:

the "Select Raster Layers to Add..." dialog window appears showing only values in the "Layers ID" column but *with the "Layer name" column blank*
!https://agiudiceandrea.github.io/QGIS330_6.PNG!
The selected raster layer(s) are then added with a correct source like
<pre>
GPKG:filepath/filename.gpkg:raster_layer_name
</pre>

but *with a blank name* instead of a proper name like "raster_layer_name" or "filename raster_layer_name" (as for vector layers).

*3)* When *a geopackage file contains both raster layer(s) and vector layer(s)* and you drag and drop the GPKG file in the map, then only raster layer(s) will be added to the map: if there is only 1 raster layer you'll fall back again in the above first case, if there are more then 1 layer you'll fall back again in the above second case.

Using the "Data Source Manager" dialog window, with the "Vector" &quot;Vetor&quot; tab you can add the contained vector layer(s) without problems, but trying to add the raster layer(s) with the "Raster" tab you will fall back again in the above first or second cases.

*4)* Using instead the *Browser panel*, raster layers in a geopackage GPKG file are always correctly added to the map with a source like:
<pre>
GPKG:filepath/filename.gpkg:raster_layer_name
</pre>
and with the name of "raster_layer_name".

*EDIT*:


These strange and incorrect behaviours also happen for *SQlite files containing rasterlite raster layers*.

*1), 2), 3*) are almost the same as the above ones, except that the source string for rasterlite rasters it's like
<pre>
RASTERLITE:filepath/filename.sqlite,table=rasterlite_layer_name
</pre>

*4)* With the Browser panel is not possible to add to the map the rasterlite rasters contained in a sqlite file, but only the related metadata tables.

Back