[FWTools] How do I populate the Geotiff Citation fields

Ron Hunt rhunt at osl.com
Thu Apr 12 19:48:39 EDT 2007


I want to create and populate two GeoTiff Metadata fields, PCSCitation and GTCitation with ASCII strings. I see how I can create GDAL metadata with the gdal_translate -mo option. How do I get these to be in the Geotiff metadata and not create a GDAL one? 
 
How would I do this within a python program. I cannot find anything that points to the specific python calls for setting metadata values when using CreateCopy in my python code (below). Where should I look for more detailed descriptions?
 
import gdal
format = "GTiff"
driver = gdal.GetDriverByName( format )
metadata = driver.GetMetadata()
if metadata.has_key(gdal.DCAP_CREATE) \
   and metadata[gdal.DCAP_CREATE] == 'YES':
 print 'Driver %s supports Create() method.' % format
if metadata.has_key(gdal.DCAP_CREATECOPY) \
   and metadata[gdal.DCAP_CREATECOPY] == 'YES':
 print 'Driver %s supports CreateCopy() method.' % format
 
src_filename = "input.tif"
dst_filename = "output.tif"
src_ds = gdal.Open( src_filename )
dst_ds = driver.CreateCopy( dst_filename, src_ds, 0, [ 'TILED=YES', 'COMPRESS=PACKBITS' ] )

 
I am a newbie - I looked through the threads and didn't see anything on this so if this has been addressed before please point me to the appropriate area.
 
Thanks for the help on this in advance

Ron Hunt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20070412/51a468ff/attachment.html


More information about the FWTools mailing list