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

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue Apr 5 10:25:09 PDT 2011


>So, how do we get the ball rolling on agreeing on a spec?

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.

>Storing the min/max values in the user's coverage table or the
>raster_columns table sounds better than making changes to the core.
>But, the min/max values may change once ST_Accum and ST_Union are
>written and applied to overlapping rasters.

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 think implementing ST_Reclass is the right approach for converting
>rasters to JPEGs and PNGs, in addition to other applications.  And since
>your example builds a custom color ramp, this should be able to provide
>all the flexibility that everyone would expect.
>
>As I prefer things to be done on the fly, I'd rather see ST_Reclass
>written in C.

Great!

>So, how do we get the ball rolling on ST_Reclass so that I can get
>coding?  I've already worked on ST_MinMax to test it out.

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.

>If it takes a while to get a consensus on a spec, I hope no one minds me
>working on ST_Transform(raster).

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.

Some questions

-How does GDAL allow resampling?
-Which methods GDAL supports? ArcGIS supports NEAREST | BILINEAR | CUBIC | MAJORITY
-Does GDAL support skew change?

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.

Have fun!

Pierre



More information about the postgis-devel mailing list