[Geotiff] How do I copy all of the header information of a GeoTIFF file?

Chris 'Xenon' Hanson xenon at 3dnature.com
Tue Sep 12 09:26:41 PDT 2006


Brad Colbert wrote:
> Hi Everyone,
> I have a small program that uses specified GeoTIFFs as templates to
> create new GeoTIFF files.  The problem I'm having is that it appears
> that I'm not properly copying all of the header information of the
> template files.  Specifically the datum and other CS parameters.  Below
> are cut-and-paste outputs of gdalinfo on, first, the template file and
> second my newly created file:

   I cheat -- I hook up a custom IO hook/callback and essentially run listgeo to a 
temporary in-memory pseudo file. Then, I use the corresponding call to reinsert that data 
into the new GeoTIFF.

   You can go even easier and just dump it to a real file in a temp directory and clean it 
up later.

-- 
      Chris 'Xenon' Hanson | Xenon @ 3D Nature | http://www.3DNature.com/
  "I set the wheels in motion, turn up all the machines, activate the programs,
   and run behind the scenes. I set the clouds in motion, turn up light and sound,
   activate the window, and watch the world go 'round." -Prime Mover, Rush.



More information about the Geotiff mailing list