Bug report #21429

error adding (from QGIS Browser) GeoPackage tile layer with identifier that does not match table name

Added by Robert St. John over 1 year ago. Updated over 1 year ago.

Status:Open
Priority:Normal
Assignee:-
Category:Browser
Affected QGIS version:3.6.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29246

Description

I cannot add a raster layer from a GeoPackage tile table whose name does not match the identifier column value in the gpkg_contents table of the GeoPackage.

Steps to reproduce:

  1. Right click the GeoPackage node in the Browser panel and select the New Connection... item.
  2. Browse to a GeoPackage file with the characteristics described above (example attached) and select Open.
  3. In the Browser panel, expand the newly added node for the GeoPackage connection. A raster layer child node should appear with the raster icon and the same name as the value of the identifier column for gpkg_contents table row for the tile table in the GeoPackage. This will be Wetsaw Test for the attached example GeoPackage.
  4. Double click the raster layer child node (or right click and select Add Layer to Project).
  5. QGIS displays an error message at the top of the canvas and a matching error message in the Log Messages panel:
     CRITICAL    Invalid Layer : GDAL provider Cannot open GDAL dataset GPKG:/path/to/tiles.gpkg:Wetsaw Test:
                 Cannot find table 'Wetsaw Test' in GeoPackage dataset
                 Raster layer Provider is not valid (provider: gdal, URI: GPKG:/path/to/tiles.gpkg:Wetsaw Test
    

If I simply drag and drop the GeoPackage onto the Layers panel, QGIS adds a raster layer for the GeoPackage name after the GeoPackage file, not the gpkg_contents.identifier column. I am not sure what QGIS does in that interaction if the GeoPackage contains multiple tile and/or feature tables.

tiles.gpkg (3.42 MB) Robert St. John, 2019-02-28 03:21 PM

History

#1 Updated by Giovanni Manghi over 1 year ago

  • Operating System deleted (macOS)
  • Category changed from Browser to Data Provider
  • Status changed from Open to Feedback

can you see the same message if you gdalinfo the gpkg in your machine?

[email protected]:~/Downloads$ gdalinfo tiles.gpkg
Warning 1: Database relies on the 'gpkg_crs_wkt' (http://www.geopackage.org/spec/#extension_crs_wkt) extension that should be implemented in order to read it safely, but is not currently. Some data may be missing while reading that database.
Driver: GPKG/GeoPackage
Files: tiles.gpkg
Size is 979, 939
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m [email protected] +wktext +no_defs"],
AUTHORITY["EPSG","3857"]]
Origin = (-8537258.699999999254942,4773269.700000000186265)
Pixel Size = (19.109257030487100,-19.109257030487100)
Metadata:
DESCRIPTION=Wetsaw Test: Baltimore area OSM tiles
IDENTIFIER=Wetsaw Test
ZOOM_LEVEL=12
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left (-8537258.700, 4773269.700) ( 76d41'29.40"W, 39d21'33.48"N)
Lower Left (-8537258.700, 4755326.108) ( 76d41'29.40"W, 39d14' 4.41"N)
Upper Right (-8518550.737, 4773269.700) ( 76d31'24.40"W, 39d21'33.48"N)
Lower Right (-8518550.737, 4755326.108) ( 76d31'24.40"W, 39d14' 4.41"N)
Center (-8527904.719, 4764297.904) ( 76d36'26.90"W, 39d17'49.05"N)
Band 1 Block=512x512 Type=Byte, ColorInterp=Red
Overviews: 489x469
Mask Flags: PER_DATASET ALPHA
Overviews of mask band: 489x469
Band 2 Block=512x512 Type=Byte, ColorInterp=Green
Overviews: 489x469
Mask Flags: PER_DATASET ALPHA
Overviews of mask band: 489x469
Band 3 Block=512x512 Type=Byte, ColorInterp=Blue
Overviews: 489x469
Mask Flags: PER_DATASET ALPHA
Overviews of mask band: 489x469
Band 4 Block=512x512 Type=Byte, ColorInterp=Alpha
Overviews: 489x469

#2 Updated by Robert St. John over 1 year ago

No, gdalinfo seems OK with it.

robertstjohn:wetsaw-out stjohnr> gdalinfo tiles.gpkg 
Driver: GPKG/GeoPackage
Files: tiles.gpkg
Size is 979, 939
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m [email protected] +wktext +no_defs"],
    AUTHORITY["EPSG","3857"]]
Origin = (-8537258.699999999254942,4773269.700000000186265)
Pixel Size = (19.109257030487100,-19.109257030487100)
Metadata:
  DESCRIPTION=Wetsaw Test: Baltimore area OSM tiles
  IDENTIFIER=Wetsaw Test
  ZOOM_LEVEL=12
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-8537258.700, 4773269.700) ( 76d41'29.40"W, 39d21'33.48"N)
Lower Left  (-8537258.700, 4755326.108) ( 76d41'29.40"W, 39d14' 4.41"N)
Upper Right (-8518550.737, 4773269.700) ( 76d31'24.40"W, 39d21'33.48"N)
Lower Right (-8518550.737, 4755326.108) ( 76d31'24.40"W, 39d14' 4.41"N)
Center      (-8527904.719, 4764297.904) ( 76d36'26.90"W, 39d17'49.05"N)
Band 1 Block=512x512 Type=Byte, ColorInterp=Red
  Overviews: 489x469
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 489x469
Band 2 Block=512x512 Type=Byte, ColorInterp=Green
  Overviews: 489x469
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 489x469
Band 3 Block=512x512 Type=Byte, ColorInterp=Blue
  Overviews: 489x469
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 489x469
Band 4 Block=512x512 Type=Byte, ColorInterp=Alpha
  Overviews: 489x469

#3 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Feedback to Open
  • Subject changed from error adding GeoPackage tile layer with identifier that does not match table name to error adding (from QGIS Browser) GeoPackage tile layer with identifier that does not match table name
  • Category changed from Data Provider to Browser

Also available in: Atom PDF