[Gdal-dev] Corrupted WKT in my GeoTIFF dem

Frank Warmerdam warmerdam at pobox.com
Fri Jul 30 16:38:27 EDT 2004


Michael Logan wrote:
> Hello,
> 
> I am trying to create a Geotiff DEM from scratch during conversion
> from GridFloat format (i've tried multple formats (int16,float32,byte)),
> but while everything seems good, the WKT is always clobbered.
> 
> I set the WKT in my C++ code, but after closing the file and exiting,
> a gdalinfo gives "badness" for the projection portion:
> 
> ------
> % gdalinfo area79.tiff
> Driver: GTiff/GeoTIFF
> Size is 21600, 7200
> Coordinate System is `'
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0, 7200.0)
> Upper Right (21600.0,    0.0)
> Lower Right (21600.0, 7200.0)
> Center      (10800.0, 3600.0)
> Band 1 Block=21600x1 Type=Int16, ColorInterp=Gray
> -----
> 
> So, my corners don't appear as Geographics corners
> as I'd hoped, since it appears no info is available
> to do the transform..

Michael,

Do you set a geotransform?  Are you sure you are closing the file properly?
What version of GDAL are you using?  Can you provide a small but complete
example program that demonstrates your problem?

I see two likely issues:
  o If you don't close the file properly, the header info likely won't be written
    properly.
  o If you just write a coordinate system but no geotransform, I don't think any
    of the geotiff info gets written out.

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