[Geopackage] Query on gpkg_tile_matrix - matrix_width and matrix_height

Pepijn Van Eeckhoudt pepijn at vaneeckhoudt.net
Wed Jun 3 05:52:03 EDT 2015


Yay, consensus :)

On 03 Jun 2015, at 11:41, Brad Hards <bradh at frogmouth.net> wrote:
> 
>> In WMTS you would use TileMatrixLimits to indicate a sub region of the
>> entire tile structure that actually contains data. GeoPackage doesn’t have
>> this, but you can achieve a similar effect using the SQL query above or the
>> extent in gpkg_contents.
> OK. I tried a WMTS client implementation once. I'd rather not think about it 
> again :-)

Tell me about it. I argued strongly to drop variable top-left corner per tile_matrix based on the frustration it caused me when I had to implement support for this in the Luciad codebase. If there’s no relationship between anymore between multiple levels of a pyramid, what’s the point of having a pyramid structure in the first place… There are probably some exotic use cases for this feature, but it complicates matter greatly for the more common ones.

>> tile_matrix_set_width = tile_matrix_set.max_x - tile_matrix_set.min_x
>> tile_matrix_set_height = tile_matrix_set.max_y - tile_matrix_set.min_y
>> tile_upper_left_x = tile_matrix_set.min_x + c * tile_matrix_set_width /
>> tile_matrix(z).matrix_width
> Or equivalently,
> tile_upper_left_x = tile_matrix_set.min_x + c * tile_matrix(z).pixel_x_size * 
> tile_matrix(z).tile_width

Yep, besides floating point error that should give you exactly the same value.

Pepijn


More information about the Geopackage mailing list