[gdal-dev] Fwd: [TC-Announce] Request for early implementations - GeoPackage 1.0

Even Rouault even.rouault at spatialys.com
Tue Aug 30 06:33:52 PDT 2016


Brad,

> I did some tests, and it looks like we'll need some code changes to pass.

Thanks for looking at this.

> 
> There is a trivial schema fix for timestamps ('now' instead of
> CURRENT_TIMESTAMP).

Seems related to that change I found in the revision history (the last one 
made apparently before promoting to final 1.0.0):

2014-01-28 R10 Paul Daisey 1.1.3.1.1, 2.4.3.1.1,
Annex C, Annex H
strftime('%Y-%m-%dT%H:%M:%fZ',
CURRENT_TIMESTAMP) changed to
strftime('%Y-%m-%dT%H:%M:%fZ','now')

> 
> There is a more complicated fix needed for
> Requirement 45 which says:
>     The width of a tile matrix (the difference between min_x and max_x in
> gpkg_tile_matrix_set) SHALL equal the product of matrix_width, tile_width,
> and pixel_x_size for that zoom level. Similarly, height of a tile matrix
> (the difference between min_y and max_y in gpkg_tile_matrix_set) SHALL
> equal the product of matrix_height, tile_height, and pixel_y_size for that
> zoom level.
> 
> That isn't true if we are doing something that doesn't fill the entire
> matrix (e.g. we only need 20 blocks instead of 32 at zoom level 5. 

Hum, indeed I guess FinalizeRasterRegistration() could be fixed so that all 
zoom levels have matrix_width and matrix_height being power of 2.

> Still
> trying to find a fix that works cleanly in a non-power of 2 matrix.

I don't think it is possible in the general case to fulfill the requirement 
with non-power of 2 pyramids, at least in a reasonable way:

For example, if the initial situation is :
zoom_level=0, matrix_width=matrix_height=1, pixel_x_size=pixel_y_size=4
zoom_level=1,matrix_width=matrix_height=2, pixel_x_size=pixel_y_size=2
zoom_level=2,matrix_width=matrix_height=4, pixel_x_size=pixel_y_size=1

And you add an overview of factor 3, then you'll need to change this to be :
zoom_level=0, matrix_width=matrix_height=1, pixel_x_size=pixel_y_size=4
zoom_level=1, matrix_width=matrix_height=???, pixel_x_size=pixel_y_size=3
zoom_level=2,matrix_width=matrix_height=2, pixel_x_size=pixel_y_size=2
zoom_level=3,matrix_width=matrix_height=4, pixel_x_size=pixel_y_size=1

Currently we must replace ??? by 2.

Of course you can still fix things by altering the matrix_width/_height so that 
zoom_level=3 is both a multiple of a power of 2 and a multiple of a power of 3 
(and also changing min_x,_y,max_x,max_y in gpkg_tile_matrix_set):

zoom_level=0, matrix_width=matrix_height=1, pixel_x_size=pixel_y_size=4
zoom_level=1, matrix_width=matrix_height=4, pixel_x_size=pixel_y_size=3
zoom_level=2,matrix_width=matrix_height=6, pixel_x_size=pixel_y_size=2
zoom_level=3,matrix_width=matrix_height=12, pixel_x_size=pixel_y_size=1

But that's completely non-sense since the extent will be completely wrong.
So I think this requirement is disputable.


Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list