Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qgib opened this issue Feb 28, 2019 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! QGIS Browser

Comments

@qgib
Copy link
Contributor

qgib commented Feb 28, 2019

Author Name: Robert St. John (@restjohn)
Original Redmine Issue: 21429
Affected QGIS version: 3.6.0
Redmine category:browser


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.


@qgib
Copy link
Contributor Author

qgib commented Mar 1, 2019

Author Name: Giovanni Manghi (@gioman)


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

giovanni@sibirica:~/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 +nadgrids=@null +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


  • operating_system was changed from macOS to
  • category_id was changed from Browser to Data Provider
  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Mar 1, 2019

Author Name: Robert St. John (@restjohn)


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 +nadgrids=@null +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

@qgib
Copy link
Contributor Author

qgib commented Mar 2, 2019

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open
  • subject was 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_id was changed from Data Provider to Browser

@qgib qgib added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label May 25, 2019
@gioman
Copy link
Contributor

gioman commented Jan 28, 2021

Still true on the latest master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! QGIS Browser
Projects
None yet
Development

No branches or pull requests

2 participants