[Gdal-dev] How to determine rotation for raster coordinate transformation

Frank Warmerdam warmerdam at pobox.com
Fri Oct 26 11:43:23 EDT 2007


Milo van der Linden wrote:
> Hello list,
> 
> I have a customer that needs a raster image in TIF and ECW format  in 
> the dutch coordinate system <EPSG:28992> to be repositioned and rotated 
> for their own GIS-like solution to UTM 32N WGS84.
> 
> When I use gdalwarp, I get a rotated image and an worldfile with it that 
> has no rotation parameters.
> 
> What I would like to know is: Is there a way to NOT rotate the image 
> itself, but determine the rotation parameters that go into the world file?

Milo,

There is no *precise* way to do this since reprojection is more than just
a rotation.  But you could get this approximate effect by transforming the
center of the top left pixel, the one to it's right, and the one below it
and using the resulting vectors to fill in values in a world file.  Then you
need to do something to estimate the right file size and pre-create it.

Unfortunately there is no way to do this directly with gdalwarp.  You would
need to write a script or small program to do it.  But if you create the
blank output file with the appropriate world file gdalwarp should be able
to transform into it properly.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list