[gdal-dev] RE: Insert non-standard tag into geotiff header

marine88 holloway.richard at geoeye.com
Mon Jun 6 13:18:39 EDT 2011


Thanks,
C# you mean?  Per your note I need to put in a arbitrary new TIFF tag.  I am a .NET guy but I did dload python.  Just not sure how to go about doing the insert.


From: Frank Warmerdam [via OSGeo.org] [mailto:ml-node+6446013-1306113036-339049 at n2.nabble.com]
Sent: Monday, June 06, 2011 12:16 PM
To: Richard Holloway
Subject: Re: Insert non-standard tag into geotiff header

On 11-06-03 04:20 PM, marine88 wrote:
> HI,
> I am new to this and was asked if I could insert a custom tag into the
> geotiff header. I have no clue on how to do this is this even possible?
...
 > Thanks for the reply.  Is this only in C?  Or is there something in C#?  Also
 > I get the function but...not quite sure how to utlize this, is there some
 > tutorial or example code I can go by?

Richard,

The SetMetadataItem() method referenced by Chaitanya is also available
in C. It can be invoked on the dataset as a whole or on a particular
band object.  The C function is:

CPLErr GDALSetMetadataItem ( GDALMajorObjectH   hObject,
                const char *   pszName,
                const char *   pszValue,
                const char *   pszDomain
        )

http://www.gdal.org/gdal_8h.html#c92aec63371e9e4b0121276406f0bd8d

So you can pass a GDALDatasetH or GDALRasterBandH as "hObject".  Yhe
pszDomain should normally be NULL unless you want to set metadata items.

Note that this puts the metadata items all into one custom GDAL tag for
metadata (which will be an XML formatted string with the various metadata
items).  There is no mechanism in GDAL to write out an arbitrary new TIFF
tag.   If you need to do that you are pretty much reduced to using the
libtiff API.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]</user/SendEmail.jtp?type=node&node=6446013&i=0>
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
[hidden email]</user/SendEmail.jtp?type=node&node=6446013&i=1>
http://lists.osgeo.org/mailman/listinfo/gdal-dev

________________________________
If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1803224.n2.nabble.com/Insert-non-standard-tag-into-geotiff-header-tp6436732p6446013.html
To unsubscribe from Insert non-standard tag into geotiff header, click here<http://osgeo-org.1803224.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6436732&code=aG9sbG93YXkucmljaGFyZEBnZW9leWUuY29tfDY0MzY3MzJ8NjY4Mjg0MDI1>.


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Insert-non-standard-tag-into-geotiff-header-tp6436732p6446025.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110606/14e3d610/attachment.html


More information about the gdal-dev mailing list