[Gdal-dev] Worldfile from SuperEdit + rotated images problems

Frank Warmerdam warmerdam at pobox.com
Thu Nov 10 11:34:54 EST 2005


On 11/7/05, Mateusz Łoskot <mateusz at loskot.net> wrote:
> 0.00000000000000 - x-scale
> 0.84666666666667 - rotation
> 0.84666666666667 - --//--
> 0.00000000000000 - y-scale
> 594958.12740300002000 - Easting and
> 373303.90045100002000 - Northing of the upper left pixel

Mateusz,

The above would seem to imply that the "top left" corner
of the raw TIFF file is the south-west corner, is that correct?

> And here comes the problem. When I open test.tif in ArcExplorer or QGIS I
> don't see anything.
> Raster is not displayed but also I get no error message.
> So it seems GeoTIFF output is broken here.

Many applications do not support GeoTIFF files that are not
north-up.  QGIS uses GDAL to read the image, but may still not
support files with non-zero rotational coefficients.  You would need
to contact the QGIS team to deal with that.

I can't speak for ArcGIS.

You might want to try loading it in OpenEV which I know
supports rotated images properly.  It should change it to
north up on the fly.

But if you want to "apply the rotation" or more accurately to
"unrotate" the image you can use gdalwarp.

eg.

gdalwarp test.tif test_unrotated.tif

> Here I also see correct CS but there is one small difference:
>
> 1. In the first output snippet:
>
> GeoTransform =
>   594957.7040696667, 0, 0.84666666666667
>   373303.4771176667, 0.84666666666667, 0
>
> 2. In the second output snippet:
>
> Origin = (594957.704070,373304.323784)
> Pixel Size = (0.84666667,-0.84666667)
>
> In this case I'm not sure which one is correct but now test.tif image is
> displayed
> well (almost) in both applications, ArcExplorer and QGIS.
> Here are some screenshots:
> http://mateusz.loskot.net/chwila/arcexplorer-rotated-raster.jpg
> http://mateusz.loskot.net/chwila/qgis-rotated-raster.jpg
>
> But please note, in both apps the test.tif is displayed rotated.
> I don't know if latest versions of ArcExplorer and QGIS support
> rotated images with worldfile.

OK, this verifies that both images just don't supported rotated images
since this image you have produced is not (georeferenced) as being
rotated.

The reason you see different ways of reporting the geotransform in
gdalinfo is that for simple northup images it simply reports the
top left corner and the pixel size ... what most people are used to see.
If the image has non-zero rotation coefficients then it reports the
full internal geotransform though it is often harder for a user to
interprete.

> My questions are:
> 1. Is this worldfile (JGW) generated by SuperEdit correct?

I presume so, though it is hard for me know.

> 2. If not, does anybody know what is this format used by SuperEdit?
> 3. Is there any way to rerotate rotated images so, then I could use 0.0
> rotation components?

My suggestion is gdalwarp'ing the image with the existing world file.
But of course lots of image editing tools will provide 90 degree rotations.
Photoshop, Gimp, ImageMagick, etc.

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    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list