[postgis-devel] Add-DropOverviewConstraints are not documented

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Wed Mar 7 14:35:52 PST 2012


Making an overview table is not that simple. 

Yes you want to first resample (actually ST_Rescale is the right function you want to use) but then you also want to Union resampled tiles 4 by 4... And right now ST_Union is VERY slow....

If you look at objective FV.21 in this page:

http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking03

I describe a possible  ST_CreateOverviews(rasttable text, rastcolumn text, overviewnumber int) function. If you want to write it in plpgsql function I would be happy to put it in the source tree and then integrate it in a future version of PostGIS. The difficulty here is to make sure the rasters in the table you want to create overviews for are regularly tiled before deciding how to create the overviews. If you look just above the ST_CreateOverview() function I also describe the ST_IsRegularlyTiled()  function. You could write the function assuming the provided is regularly tiled and hence not have to bother about ST_IsRegularlyTiled() which is more complicated...

The most complicated part is to create an identifier on which to Union tiles once they are resampled... I think you could do this by moving a buffer with an id around a larger grid to mark the tiles "to be unioned together afterward... But I'm giving too many details....

Would be even nicer if all those function would work as aggregate on any sub selection instead of on a fixed table name.

Let me know if you come up with something we can reuse.

Pierre


> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net [mailto:postgis-devel-
> bounces at postgis.refractions.net] On Behalf Of Jose Carlos Martinez Llario
> Sent: Wednesday, March 07, 2012 4:48 PM
> To: PostGIS Development Discussion
> Subject: Re: [postgis-devel] Add-DropOverviewConstraints are not documented
> 
> Hi, yes that is what I meant.
> 
> Using ST_resample I can manage my own spatial raster tables to make
> overviews.
> Then next step will be to use addrasterconstrains and addoverviewconstraints.
> 
> Am I missing something?
> If not, we dont need these functions to be documented?
> 
> 
> 
> On 07/03/2012 22:46, dustymugs wrote:
> > Jose,
> >
> > I don't believe there is a function yet for generating overviews from
> > an existing raster layer.  You can do something like it though using
> > ST_Resample(ST_Union(...)).
> >
> > (Add|Drop)OverviewContraints is for applying the flags/constraints
> > that indicate a raster column as an overview of another table.
> >
> > -bborie
> >
> > On 03/07/2012 01:35 PM, Jose Carlos Martinez Llario wrote:
> >> Hi,
> >> If one want to make an overview from an already existing raster layer
> >> I guess we should use AddOverviewConstraints.
> >>
> >> Should AddOverviewConstraints and DropOverviewConstraints be
> documented?
> >>
> >> Best,
> >> Jose
> >>
> >>
> >> _______________________________________________
> >> postgis-devel mailing list
> >> postgis-devel at postgis.refractions.net
> >> http://postgis.refractions.net/mailman/listinfo/postgis-devel
> >>
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-devel
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list