[Geopackage] Query on gpkg_tile_matrix - matrix_width and matrix_height

Brad Hards bradh at frogmouth.net
Thu May 28 18:34:23 EDT 2015


Geopackage spec (2.2.7.1.1) describes the gpkg_tile_matrix table.

matrix_width and matrix_height are described as >=1.

The note below Requirement 44 says that there can be records for zoom levels 
that do not have any tiles populated.

However I can't find an authoritative reference that says what matrix_height 
and matrix_width are intended to describe. I assume that they're meant to be a 
describe the "framework" for the tiles. So if we're power of two, and the next 
higher matrix_width was 2, then this matrix_width will be 4 (irrespective of 
what tiles are actually populated).

Another way of saying this is that pixel_x_size * tile_width * matrix_width 
for a given table_name should always be a constant (and that constant is equal 
to max_x - min_x from the matching entry in gpkg_tile_matrix_set), and the 
same general relationship applies in the Y/height dimension. For constant, I 
mean within floating point error tolerances, not absolutely identical.

Is this the intent?

If not, what is the intent?

If so, the ERDC Whitehorse set on the geopackage.org site is inconsistent with 
that intent:
sqlite> SELECT zoom_level, matrix_width * pixel_x_size * tile_width FROM 
gpkg_tile_matrix;
zoom_level|matrix_width * pixel_x_size * tile_width
11|39135.7584820102
12|29351.8188615077
13|29351.8188615077
14|26905.833956382
15|25682.8415038192
16|25071.3452775378
17|24765.5971643971
18|24765.5971643971


Brad



More information about the Geopackage mailing list