[Geopackage] Bounding boxes for tiles

Brad Hards bradh at frogmouth.net
Sat Jan 18 06:33:02 EST 2014


I'm updating my old code for converting the output of gdal2tiles.py to 
geopackage. A typical index file (tilemapresource.xml) looks like:

<?xml version="1.0" encoding="utf-8"?>
        <TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
          <Title>pap.vrt</Title>
          <Abstract></Abstract>
          <SRS>EPSG:900913</SRS>
          <BoundingBox minx="18.39785146190368" miny="-72.43391470757965" 
maxx="18.67206370360821" maxy="-72.18546427890816"/>
          <Origin x="18.39785146190368" y="-72.43391470757965"/>
          <TileFormat width="256" height="256" mime-type="image/png" 
extension="png"/>
          <TileSets profile="mercator">
            <TileSet href="10" units-per-pixel="152.87405654296876" 
order="10"/>
            <TileSet href="11" units-per-pixel="76.43702827148438" 
order="11"/>
            <TileSet href="12" units-per-pixel="38.21851413574219" 
order="12"/>
            <TileSet href="13" units-per-pixel="19.10925706787109" 
order="13"/>
            <TileSet href="14" units-per-pixel="9.55462853393555" order="14"/>
            <TileSet href="15" units-per-pixel="4.77731426696777" order="15"/>
            <TileSet href="16" units-per-pixel="2.38865713348389" order="16"/>
          </TileSets>
        </TileMap>

In this case, there are four tiles at zoom level 10, where the actual content 
is shown the bounding box above.

My reading of the current (OK, r9) spec text is that the bounds in 
gpkg_tile_matrix_set must reflect the full world (-180.0 to 180.0, and 
something like -85 or -90 to 90 or 85, depending on how the tiles are build / 
transformed), so that you can:
1. Add more tiles
2. calculate where the tiles go.

However for gpkg_contents, the bounds should reflect the actual content (i.e. 
should match BoundingBox in the XML above).

Does anyone interpret it differently?

Brad


More information about the Geopackage mailing list