Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6871 closed defect (invalid)

GeoPackage raster mosaic tile indices are mapped to the wrong co-ordinates

Reported by: tbarsballe Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 2.0.2
Severity: normal Keywords: geopackage
Cc:

Description

When reading a GeoPackage raster mosaic using GDAL (via QGIS 2.14.8), it appears that the y-axis tile indices are read in the wrong order.

I am using a GeoPackage raster mosaic generated using GeoServer WMS, with the GeoPackage output format (GeoServer version 2.11, latest nightly build). GeoServer is able to read and display this GeoPackage without issues.

Examining the GeoPackage with an SQLite viewer, for zoom level 1 I see the (0,0) tile is at -180,-90 (bottom-left) and the (3,1) tile is at 180,90 (top-right), which seems correct (and leads me to believe this is indeed a GDAL bug rather than a GeoServer bug).

However, when trying to view this GeoPackage using QGIS, the bottom-left tile ends up top-left, and the top-right tile ends up bottom-right.

Attachments (3)

zoom-level-0.png (164.6 KB ) - added by tbarsballe 7 years ago.
Output at zoom level 0 (correct)
zoom-level-1.png (110.4 KB ) - added by tbarsballe 7 years ago.
Output at zoom level 1 (error)
zoom-level-2.png (177.9 KB ) - added by tbarsballe 7 years ago.
Output at zoom level 2 (error)

Download all attachments as: .zip

Change History (6)

by tbarsballe, 7 years ago

Attachment: zoom-level-0.png added

Output at zoom level 0 (correct)

by tbarsballe, 7 years ago

Attachment: zoom-level-1.png added

Output at zoom level 1 (error)

by tbarsballe, 7 years ago

Attachment: zoom-level-2.png added

Output at zoom level 2 (error)

comment:1 by Even Rouault, 7 years ago

Resolution: invalid
Status: newclosed

I think I reported a long time ago that GeoServer doesn't generate GeoPackage correctly. In GeoPackage tile (0, 0) is the top-left tile, like in WMTS. Which is unlike MBTiles

See http://www.geopackage.org/spec/#tile_matrix """ The tile coordinate (0,0) always refers to the tile in the upper left corner of the tile matrix at any zoom level, regardless of the actual availability of that tile. """

GDAL / QGIS can correctly read tiles from other implementations referenced at http://www.geopackage.org/#sampledata like https://portal.opengeospatial.org/files/?artifact_id=73648

comment:2 by tbarsballe, 7 years ago

Thank you for the response; I was initially unable to find where in the GeoPackage spec the upper left tile was defined, but I see it in the document you linked. I will migrate this to the GeoTools bug tracker.

Note: See TracTickets for help on using tickets.