[gdal-dev] Copy / manipulate TIFF-header
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.
However, I do not know that tiffset supports GeoTIFF tags.
On Mar 4, 2010, at 2:07 AM, Sigbjorn Herstad wrote:
> 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:
> 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):
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev