[gdal-dev] Copy / manipulate TIFF-header

Greg Coats gregcoats at mac.com
Thu Mar 4 20:44:29 EST 2010


A .tif file in organized such that it begins with a very small header, is followed by all of the pixels, and then the file ends with the TIFF tags.
So, if one wanted to change or set for example the TIFF resolution tags, there are three resolution tags: XResolution=282, YResolution=283, and ResolutionUnit=296, it is possible and convenient to write TIFF tags 282, 283, and 296 that follow the pixels values, near the end of the .tif file, withOUT re-writing any of the pixel values. The TIFF utility tiffset provides a convenient way for changing TIFF tags withOUT reading and writing any of the pixel values, and even supports setting a TIFF tag to the contents of a file.
http://www.remotesensing.org/libtiff/man/tiffset.1.html

However, I do not know that tiffset supports GeoTIFF tags.
Greg

On Mar 4, 2010, at 2:07 AM, Sigbjorn Herstad wrote:

> Hi,
> 
> This is my first post here, but have followed the list for several
> years. I am trying to find a good way to edit a GeoTIFF-header. I have
> looked at the Python-script and listgeo and geotifcp mentioned here:
> http://lists.osgeo.org/pipermail/gdal-dev/2008-April/016752.html
> 
> Using the Python-script updates the header of a given GeoTIFF- however
> not with all parameters I need. Using the listgeo and geotifcp a new
> file is written so update is not possible (like in the Python-script)
> - ie reprocessing all files are necessary. I am thinking about
> creating a Python-script which will update / delete / add certain
> attributes from a GeoTIFF-file, but I am not sure if this is possible?
> I do NOT want to create a new file with the changed GeoTIFF-header,
> but update the already existing one.
> 
> Here are some of the TAGS I wish to DELETE or CHANGE:
> GTModelTypeGeoKey (Short,1):
> GTRasterTypeGeoKey (Short,1):
> GTCitationGeoKey (Ascii,8):
> GeogCitationGeoKey (Ascii,7):
> GeogAngularUnitsGeoKey (Short,1):
> ProjectedCSTypeGeoKey (Short,1):
> ProjLinearUnitsGeoKey (Short,1):
> GCS:
> Datum:
> Ellipsoid:
> 
> Greetings
> SigTill

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100304/c65229a4/attachment.html


More information about the gdal-dev mailing list