[Geopackage] Query on gpkg_tile_matrix - matrix_width and matrix_height

Cochran, Jenifer jenifer.cochran at rgi-corp.com
Fri Jun 5 10:19:33 EDT 2015


Responses in line again- Thanks!

From: Pepijn Van Eeckhoudt [mailto:pepijn at vaneeckhoudt.net]
Sent: Friday, June 05, 2015 9:18 AM
To: Cochran, Jenifer
Cc: Brad Hards; geopackage at lists.opengeospatial.org
Subject: Re: [Geopackage] Query on gpkg_tile_matrix - matrix_width and matrix_height


On 05 Jun 2015, at 14:32, Cochran, Jenifer <jenifer.cochran at rgi-corp.com<mailto:jenifer.cochran at rgi-corp.com>> wrote:

I believe the fundamental difference we are discussing here is between relative tile numbering and absolute tile numbering.  For example, let's say you have data at zoom level 1 but you only have the lower right tile (Tile bounds: (0, 0, 180, -85.0511287798066) (min_x, min_y, max_x, max_y)). In absolute tile numbering, like in the google web mercator tiling structure, you would number this tile (1,1) and your matrix_width and matrix_height would be 2 by 2. In relative tile numbering, like the spec requires (using the bounds (0, 0, 180, -85.0511287798066)  as the MBR) ,you would number this tile (0,0) and a matrix_width and matrix_height 1 by 1.

And this is the essence of the problem. In your solution, how do you know the bounds of this tile is (0, 0, 180, -85.0511287798066)? There’s no way to derive that from the metadata.

Continuing on the google mercator example, the extent in gpkg_tile_matrix_set will be [-180,180] [-85.0511287798066, 85.0511287798066]. Combining that with tile row/column (0,0) and matrix_width/height (1,1), there’s no way to arrive at tile bounds [0,180][-85.0511287798066,0]. The missing bit of information here is what your anchor point (top-left corner in WMTS terms) is. In GeoPackage that’s always the top-left corner of the extent in gpkg_tile_matrix_set. There’s no way to let this vary per tile_matrix.

The bounds [0,180][-85.0511287798066,0] is the MBR in the gpkg_tile_matrix_set.  That tile is the top-left corner in WMTS terms, which is numbered (0,0). Let me extend the example further.  When you zoom in to level 2, then the numbering would continue from the same bounds of the data. The next level matrix_width and matrix_height would be 2 by 2 with numbered as follows:

[0,0] [1,0]
[0,1] [1,1]

The bounds of these four tiles at zoom level 2 would be the MBR [0,180][-85.0511287798066,0].


Best regards,

Pepijn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengeospatial.org/pipermail/geopackage/attachments/20150605/7169ec2d/attachment-0001.html>


More information about the Geopackage mailing list