[postgis-devel] WKTRaster ST_MapAlgebra

David Zwarg dzwarg at avencia.com
Fri Feb 19 09:11:22 PST 2010


>
> False. Two rasters in the same coordinate system may have different rotations (in their georeference). You can rotate a raster in ArcMap in the Georeferencing tool bar using the rotate tool. You can then export the georeference as a World file (in ArcToolBox). The rotation parameters are the D and B parameters in a World File (http://en.wikipedia.org/wiki/World_file). This has nothing to do with the coordinate system.
>
> It is hard to play with geotiff because the georeference in the geotiff always has precedence on the world file (please confirm). One way to test is to rotate a geotiff in ArcMap using the Georeferencing toolbar, export the World file, convert the tif to jpeg, change the name of the world file to match the one of the jpeg and then open the jpeg. You can then play with the rotation directly in the world file. Adding to the confusion is the fact that some softwares do not support display or conversion of rotated raster file.


Thanks for the tip!  I'll try that.  I had been looking in the toolbox
for all the manipulations -- I'll give the georeference toolbar a
shot.


> Having this result I would feel that I loose information in the process. I would probably have prefered that the resulting raster cell size matches the A raster cell size. I would then like to be able to specify the input raster that give its cell size to the output raster. This is what I would call the "master raster". It could simply be the first raster passed to the function. I would probably also like to set my own cell size as well.


I agree that information is lost in the process. So the cell size is
set to the cell size in the first raster parameter ("master"), or
overridden by an optional cell size parameter?


> >So it would appear that the resample operation does imply a realignment (I can confirm translation
> >only, not rotation), and that it is not possible to resample without realignment.
>
> PostGIS has a function which snap geometries to a grid (http://postgis.refractions.net/documentation/manual-1.5/ST_SnapToGrid.html) I would probably want to be able to similarly snap my raster to a grid like this when resampling. These parameter should be passsable to both ST_MapAlgebra() and ST_Resample(). We could also create a RasterGrid kind of object carrying those four parameters. Then we would have full control over the alignment/cell size of resulting rasters in many operations. A feature that lack in many package (maybe I'm too adventurous here).


That sounds like you would want ST_MapAlgebra to look like:

ST_MapAlgebra(rastergrid|geometry, [rastergrid|geometry,...],
‘mathematical expression’, ‘rastergrid’ |’geometry’) ->
rastergrid/geometry

where the 1st 'rastergrid' was the master, or:

ST_MapAlgebra(raster|geometry, [raster|geometry,...], ‘mathematical
expression’, ‘raster’ |’geometry’, originx, originy, pixelsizex,
pixelsizey) -> raster/geometry

Is that correct?

Thanks,
Zwarg



More information about the postgis-devel mailing list