[postgis-devel] Regular raster blocking (was: Real extent feature lost after metadata as views)

Sandro Santilli strk at keybit.net
Thu Dec 6 06:11:27 PST 2012


On Thu, Dec 06, 2012 at 01:19:11PM +0000, Mateusz Loskot wrote:
> On 6 December 2012 12:38, Sandro Santilli <strk at keybit.net> wrote:

> > If you want the extent to remain immutable there should be an explicit
> > extent constraint (only computed when missing).
> 
> I'm not suggestion it's immutable.
> AFAIU Pierre's modified proposal, the overall extent is computed
> based on the actual tile set.

Actually, I think I am, as that'd be the only way for the reader
to know what the grid looks like. It does know the width/height
of each cell but it's missing the upper-left corner, which completes
the picture.

This would be only true for regular blocked.

> >   - Each tile belongs to exactly _one_ block
> >     (so no tile crosses block boundary)
> >   - Every block contains at most _one_ tile
> 
> 
> We have the following situations possible:
> 1) tile is missing (implicit NODATA tile of width == max_blocksize_x
>     and height == max_blocksize_y, UL of cell == UL of tile)
> 2) tile fills cell (width == max_blocksize_x and height == max_blocksize_y,
>     UL of cell == UL of tile)
> 3) tile partially fills cell (width < max_blocksize_x and height <
> max_blocksize_y)
> 
> Where is UL corner of a partial tile in the case 3) allowed?

Right, see above. As long as we know how the regular block grid
looks like we can tell the UL corner of a partial tile by simple
math:

  Column: floor( ( minx(tile) - minx(extent) ) / cell_width )
     Row: floor( ( miny(tile) - miny(extent) ) / cell_height )

--strk;



More information about the postgis-devel mailing list