geopackage output may be incorrect
References:
Geopackage spec (http://www.geopackage.org/spec/#_tile_matrix_set)
WMTS spec (http://portal.opengeospatial.org/files/?artifact_id=35326 Annex H.1 specifically)
The way the gpkg_tile_matrix table's matrix_width and matrix_height columns are populated might be wrong. I think the width and height are supposed to say how many tiles -could- fit into the bounding region as specified by gpkg_contents min/maxs, not how many tiles are actually in the gpkg file.
Example:
What I expect for a tile set that contains the whole globe and has 1 tile for zoom_level 0, and 1 for zoom_level 19
TABLE gpkg_tile_matrix
ROW 1
COL zoom_level 0
COL matrix_width 1
COL matrix_height 1
other COLS...
ROW 2
COL zoom_level 19
COL matrix_width 524288 (where MOBAC seems to put 1 here, since only 1 tile exists for this zoom in this file)
COL matrix_height 524288 (where MOBAC seems to put 1 here, since only 1 tile exists for this zoom in this file)
other COLS...
I feel this is correct, since it provides a simpler means of finding a tile x/y from a coordinate x/y, and the number of rows/cols for a zoom_level is easily found with a query, where expected number of rows/cols isn't.
I'm not 100% convinced since I only have 1 other geopackage source to compare against and it has a different, more obviously wrong, bug.
Yes, GeoPackage output is incorrect/defect.
However I don't understand this format. Therefore I decided to abandon it. Further releases will not include it anymore.
If you have the knowledge and skill to correct the implementation you are welcome to fix it.
Got a possible fix in the works. Waiting for access to examples from other sources to compare against to make sure it makes valid geopackages. Should have access to ones generated by ArcGIS within a few days.
What has happened to it?
GeoPackage is still in the list of supportet formats:
https://mobac.sourceforge.io/wiki/index.php/Atlas_formats
Would be nice to have it, as its on of the better performing formats:
https://geoinformatik.htw-dresden.de/abschlussarbeiten/2021_BA_Stuellein/ergebnisse.html#prettyPhoto
The state of GeoPackage atlas creator has not changed since the creation of this issue.
The standard is pretty complex and I don't have access to any software that creates or reads maps/atlases in GeoPackage format. Therefore it is not clear what is wrong with the implementation currently included in MOBAC.
Feel free to to take a look into the current implementation yourself [1] or look at it's created atlases and describe what exactly is wrong and what would be the correct way to do it.
[1] https://svn.code.sf.net/p/mobac/code/trunk/MOBAC/mobac/src/main/java/mobac/program/atlascreators/GeoPackage.java
Last edit: r_x 2023-03-28