[Geotiff] More problems

Frank Warmerdam warmerdam at pobox.com
Wed Nov 10 09:21:58 EST 2004


Kieron Flynn wrote:
> Hi All,
>  
> Well, worked out the things I need to put in to create a custom datum (I 
> think!) with kind help from Frank Warmerdam.
> However I've got a strange one, I pass the following array in to the 
> libtiff library,
>  
> unsigned short GeoKeyDirectory[] =
>   {
>    1,      1, 2, 15,     // 1 - version 1, revision 1.2,  3 keys defined

...
>    ProjScaleAtNatOriginGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 4,
>  //  ProjStdParallel1GeoKey,TIFFTAG_GEODOUBLEPARAMS,  1, 5,
>    0,0,0,0
>   };
>  
>   TiffError = TIFFSetField( m_pTiff, TIFFTAG_GEOKEYDIRECTORY, sizeof( 
> GeoKeyDirectory ), GeoKeyDirectory );
>   ok &= TestTiffError( TiffError, _T("TIFFTAG_GEOKEYDIRECTORY") );

Kieron,

First, shouldn't you be passing sizeof(GeoKeyDirectory)/sizeof(unsigned short)
as the "count" value to TIFFSetField?  Second, is the 4th argument in
GeoKeyDirectory supposed to be the key count?  If so, shouldn't it be 20
instead of 15?  I am just guessing on the count since I don't normally
write GeoKeyDirectory directly.

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 Geotiff mailing list