[gdal-dev] Rotate unreferenced tiff file by -90 degrees
Zoltan Szecsei
zoltans at geograph.co.za
Thu Mar 17 10:49:58 EDT 2011
On 2011-03-17 15:34, Frank Warmerdam wrote:
> On 11-03-17 05:09 AM, Wesley Roberts wrote:
>> Dear gdal'ers
>>
>> I am working with TRMM rainfall data from an HDF5 file (converted
>> from hdf4
>> to hdf5). I am able to use gdal_translate to extract the gridded data
>> from
>> the HDF file using the following command.
>>
>> gdal_translate -of GTiff
>> "HDF5:"3A25.071201.6A.h5"://DATA_GRANULE/PlanetaryGrid2/e_surfRainMean2"
>> test.tif
>>
>> Gdal_translate works a treat and writes out the test.tif file perfectly,
>> however, the file is unreferenced and needs to be rotated by -90
>> degrees. Is
>> it possible to do this using gdal_translate or do I need to make use of
>> gdalwarp as well? My tiff world file needs to look something like this
>>
>> 0.500000 0.0000000 0.0000000 -0.500000 -179.750000 36.750000
>>
>> Am I correct in assuming that a suitable proj4 statement might do the
>> trick,
>> wrt assigning projection info and defining rotation? If so can
>> someone point
>> me towards a document explaining the various proj4 declaration
>> parameters,
>> or give me some advice on how to go about getting the data properly
>> referenced.
>
> Wesley,
>
> I think the easiest approach is to prepare a worldfile representing the
> current georeferencing in east-up or west-up orientation. Then use
> gdalwarp to transform it to north up.
>
> gdalwarp input.tif output.tif
>
> For "east up" I think the world file might look something like:
>
> 0.0
> 0.5
> 0.5
> 0.0
> top-left-x
> top-left-y
>
> You might need to fiddle around with the orientation a bit to get it
> right.
>
> Best regards,
But presumable the pixel sizes (1st & 4th) would not be zero?
--
===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
P.O. Box 7, Muizenberg 7950, South Africa.
65 Main Road, Muizenberg 7945
Western Cape, South Africa.
34° 6'16.35"S 18°28'5.62"E
Tel: +27-21-7884897 Mobile: +27-83-6004028
Fax: +27-86-6115323 www.geograph.co.za
===========================================
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1498/3510 - Release Date: 03/16/11
More information about the gdal-dev
mailing list