4

I added two rasters to QGIS: "site01.tif" and "site02.tif" then added them to a geopackage. When I drag the geopackage into QGIS, the geopackage layers display as expected but the layer names are blank in QGIS' Layer panel. I got the idea that they should just display automatically from watching this video: https://www.youtube.com/watch?v=_KuTfTd9RKc

I used the following to create the geopackage and add the two rasters:

C:\>gdal_translate -co APPEND_SUBDATASET=YES -co RASTER_TABLE=site01 -a_srs EPSG:2258 -of GPKG C:\Users\richard\Desktop\geopackage-temp\site01.tif C:/Users/richard/Desktop/geopackage01.gpkg
Warning 1: TIFFFetchNormalTag:Incompatible type for "RichTIFFIPTC"; tag ignored
Input file size is 26294, 40994
0...10...20...30...40...50...60...70...80...90...100 - done.

C:\>gdal_translate -co APPEND_SUBDATASET=YES -co RASTER_TABLE=site02 -a_srs EPSG:2258 -of GPKG C:\Users\richard\Desktop\geopackage-temp\site02.tif C:/Users/richard/Desktop/geopackage01.gpkg
Warning 1: TIFFFetchNormalTag:Incompatible type for "RichTIFFIPTC"; tag ignored
Input file size is 46713, 44301
0...10...20...30...40...50...60...70...80...90...100 - done.

C:\>gdalinfo C:\Users\richard\Desktop\geopackage01.gpkg
Driver: GPKG/GeoPackage
Files: C:\Users\richard\Desktop\geopackage01.gpkg
Size is 512, 512
Coordinate System is `'
Subdatasets:
  SUBDATASET_1_NAME=GPKG:C:\Users\richard\Desktop\geopackage01.gpkg:site01
  SUBDATASET_1_DESC=site01 - site01
  SUBDATASET_2_NAME=GPKG:C:\Users\richard\Desktop\geopackage01.gpkg:site02
  SUBDATASET_2_DESC=site02 - site02
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

C:\>

I drag the geopackage into QGIS with no issues however, the layer names are blank in the side panel. In the image below, "site01" and "site02" are the original rasters. The two no-name rasters are the two geopackage layers.:

enter image description here

The layer names are also blank when I drag the geopackage into the project:

enter image description here

I'm expecting to see "site01" and "site02" in the Layers panel for both the original rasters AND the geopackage layers. Instead, the original rasters display their names but the geopackage layers are blank.I'm assuming that the layer name would parse from the RASTER_TABLE.

QGIS 3.6.3

GDAL/OGR 2.4.1

Windows 10 Pro

3

I would say that QGIS should show the name as is appears in the "gpkg_contents" table and take it either from field "table_name" or perhaps rather from field "identifier". I repeated your test locally with QGIS 3.4.4 and verified your result. The names in "gpkg_contents" are OK as can be seen from the atteched image but QGIS shows blanks. I would write to QGIS mailing list and ask if this is a known issue and create a bug report if it is not.

enter image description here

  • Thanks for letting me know it's not just my install. I'll check with the QGIS folks. – Richard May 25 at 1:30
1

I tried this and have a couple of additional observations. If I drag a geopackage into a qgis project, the raster layers are not named, as was the experience of the OP. However, my geopackage also contains vector layers. These are not imported at all when the geopackage is dragged into the project.

However, if I navigate to the geopackage in the qgis browser, I see all layers, complete with names. If I drag a layer (raster or vector) from the browser into the project, the name is correctly displayed in the legend pane.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.