[Gdal-dev] more problems
Frank Warmerdam
warmerdam at pobox.com
Sat Nov 30 16:00:06 EST 2002
Vladimir,
OK, I have spent a few more hours hacking and have made several improvements:
o I now write GTCitationGeoKey with the high level coordinate system
description from the well known text.
o It is now possible to update the projection information and metadata of
a existing GeoTIFF file in place. This may only work for uncompressed
files ... I don't know it is currently supported to open compressed geotiff
files in update mode. This is a very new and experimental ability!
o Metadata can be written to files created directly as well as those
created with CreateCopy().
o I added support for generic metadata. Any metadata items other than
the special TIFFTAG_* values will be written new a new tiff tag I have
defined in a simple XML format, and they are also recovered when reading
the file. This metadata will only be meaningful to GDAL based applications
but it should be useful for stuff like using GeoTIFF as the generic "import"
format for raster data in applications like OpenEV. Eventually I would like
to use a similar mechanism to associate stuff like NODATA values with
GeoTIFF bands.
Some of the above changes required bug fixes in libtiff, so if you use an
external libtiff please ensure it is rebuilt from CVS, or reconfigure your
GDAL to use the internal libtiff (which has been updated from the libtiff
CVS tree).
All testing and feedback on the new capabilities is appreciated.
For interest sake, I was able to use the following python script to test the
inplace update of information on tiff files:
import gdal
import sys
import osr
driver = gdal.GetDriverByName( 'GTiff' )
ds = gdal.Open( 'test.tif', gdal.GA_Update )
md = { 'TIFFTAG_DOCUMENTNAME' : 'Third test', 'OTHERINFO' : 'New value', 'NewTag' : 'This
tags value' }
ds.SetMetadata( md )
srs = osr.SpatialReference()
srs.SetFromUserInput( '+proj=utm +zone=11 +ellps=WGS84' )
ds.SetProjection( srs.ExportToWkt() )
ds.SetGeoTransform( [ 100000, 10, 0, 50000, 0, -10 ] )
ds = None
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