[postgis-devel] WKTRaster ST_MapAlgebra

David Zwarg dzwarg at avencia.com
Sat Feb 20 06:57:41 PST 2010


>>
>>That sounds like you would want ST_MapAlgebra to look like:
>>
>>1- ST_MapAlgebra(rastergrid|geometry, [rastergrid|geometry,...],
>>'mathematical expression', 'rastergrid' |'geometry') ->
>>rastergrid/geometry
>>
>>where the 1st 'rastergrid' was the master, or:
>>
>>2- ST_MapAlgebra(raster|geometry, [raster|geometry,...], 'mathematical
>>expression', 'raster' |'geometry', originx, originy, pixelsizex,
>>pixelsizey) -> raster/geometry
>
> Sounds good! (I assume that rastergrid in the first one is actually a raster)

I wasn't thinking rastergrid would be a raster, I was borrowing from
your idea where you mentioned: "We could also create a RasterGrid kind
of object carrying those four parameters."  So the first method would
be carrying all the position and size parameters inside this
RasterGrid object, whereas the second method would use a basic Raster
object, and explicitly specify the position and size parameters.

Although, as I think about it more, this RasterGrid is redundant --
aren't all the position, size, and alignment parameters inside of
Raster already?  In that case, then rastergrid is synonymous with
raster, and I didn't fully understand what you meant when you
mentioned creating a RasterGrid object.


On a side note, I was looking into the MapAlgebra operations on two
rasters in the same CS, but with different rotations:  the cell size
of the resulting raster (by default) is the smallest cell at 0
rotation that would encapsulate a rotated cell.  In my experiment, I
rotated a raster 45 degrees and did a simple add (A+B).  The input
cell size was 1, and the output cell size was ~1.4, or sqrt(2).

I'll work on updating the wiki page based on this thread.

Zwarg



More information about the postgis-devel mailing list