[postgis-devel] 8BUI JPEG and PNG raster export

Bborie Park bkpark at ucdavis.edu
Tue Apr 5 13:00:37 PDT 2011

> Normally the Wiki spec should be the final reference. So you should update it with what we will decide here. You have in write access to the wiki? Do you? It's very convenient as it is also used as a reference by the people writing the documentation.

Will do.  I was wondering what the procedure was for updating the specs. 
  I do have write access but haven't done anything with it.

> Right. In this case I would suggest to rely on triggers or just refreshing those values by hand. This must be done also if you add tiles to the coverage or edit a tile.

I suspect the triggers will typically need to be written by the end 
user.  As things develop, I'll have to do some testing with the center's 
datasets to see how bad the performance is on large datasets (~800,000 
pixels per coverage).

> I suggest you add specifications based on this discussion in the Wiki. I will review it and maybe Regina, Jorge and then you`re free. Fill a ticket to concentrates discussions.
> So discussion in the ticket and final specifications in the wiki. Tickets, in my point of view, are not really good to final spec something.

Will do.  As I've already written several functions, I've got some 
adding tickets and updating ahead of me.

> As you like. Here are the variants I was planning for ST_Resample:
> -ST_Resample(raster, pixelsize) -modify pixel size
> -ST_Resample(raster, method, pixelsize) -modify pixel size
> -ST_Resample(raster, scalex, scaley) -modify pixel size
> -ST_Resample(raster, method, scalex, scaley) - modify pixel size
> -ST_Resample(raster, x, y, scale) - realign and modify pixel size
> -ST_Resample(raster, method, x, y, scale) - realign and modify pixel size
> -ST_Resample(raster, x, y, scalex, scaley) - realign and modify pixel size
> -ST_Resample(raster, method, x, y, scalex, scaley) - realign and modify pixel size
> -ST_Resample(raster, x, y, scale, skew) - realign and modify pixel size&  rotation
> -ST_Resample(raster, x, y, scalex, scaley, skewx, skewy) - realign and modify pixel size&  rotation
> -ST_Resample(raster, method, x, y, scalex, scaley, skewx, skewy) - realign and modify pixel size&  rotation
> -ST_Resample(raster, raster) - realign and modify pixel size&  rotation based on the gereference of another raster
> -ST_Resample(raster, raster, method) - realign and modify pixel size&  rotation based on the georeference of another raster
> They allow to merely change the pixel size and/or the alignment and/or the rotation with different methods. I didn't study the GDAL possibilities before writing this.
> X and Y are any point in the world space on which one target raster pixel corner can snap to. This is not necessarily a raster corner (upper left or lower right).
> There should be a default method if many are available.

I haven't given much thought to ST_Resample or any of the other 
functions described in FV.06.  I was going to start with ST_Transform 
first but since reprojecting and warping do go hand in hand, I'll have 
to do some digging.

> Some questions
> -How does GDAL allow resampling?

Probably through the same mechanisms as gdalwarp.  The real question is 
how much of the Warp API is supported in C vs the native C++.  According 
to the docs, there is a statement indicating that the C bindings are 
incomplete for the Warp API.

> -Which methods GDAL supports? ArcGIS supports NEAREST | BILINEAR | CUBIC | MAJORITY

Based upon the resampling methods stated for gdalwarp:

-r resampling_method:
     Resampling method to use. Available methods are:

         nearest neighbour resampling (default, fastest algorithm, worst 
interpolation quality).
         bilinear resampling.
         cubic resampling.
         cubic spline resampling.
         Lanczos windowed sinc resampling.

> -Does GDAL support skew change?

I have no ideas.

> I suggest, again, that you review, comment, enhance and burn thoses specs in the wiki before going too far. Open a ticket and burn the result in the wiki.

I think I'll be spending the next day or so adding new tickets (e.g. 
ST_MinMax), updating existing tickets (e.g. ST_Band, ST_asGDALRaster, 
ST_Tiff) and asking more questions.


Bborie Park
Center for Vectorborne Diseases
UC Davis
bkpark at ucdavis.edu

More information about the postgis-devel mailing list