[Gdal-dev] tifw?

Frank Warmerdam warmerdam at pobox.com
Tue Jan 20 15:36:03 EST 2004


Tom Parker wrote:
> Hello,
> 
> Is it possible to convert tif/tifw pairs to GeoTIFF files with the gdal
> utilities? I found a few references in the docs to world files but no
> examples of conversion.

Tom,

This can be done with the libgeotiff utilities (geotifcp) or with GDAL
utilities.  With gdal_translate, you could, for instance, do something like
the following to convert in.tif and in.tfw into a geotiff file with the
coordinates coming from in.tfw, and the coordinate system set to UTM 17 WGS84:

   gdal_translate -a_srs '+proj=utm +zone=17 +datum=WGS84'  in.tif out.tif

Pretty easy eh?

Basically, GDAL's GeoTIFF driver will read the .tfw file by default if there
is not geotiff info in the .tif file, and the GeoTIFF driver by default writes
the coordinate info in the output .tif file.  The -a_srs option allows you
to assign a coordinate system using a variety of mechanisms including
PROJ.4 style strings as I show, by EPSG zone, or by OGC WKT.

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