[Geotiff] More problems

Kieron Flynn kieron at intelliscan.co.uk
Wed Nov 10 09:10:13 EST 2004


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
   GTModelTypeGeoKey,  0, 1, ModelTypeProjected,
   GTRasterTypeGeoKey,  0, 1, RasterPixelIsArea,
   GTCitationGeoKey,  TIFFTAG_GEOASCIIPARAMS, 20, 0,
   GeographicTypeGeoKey, 0, 1, 32767,    // User_Defined
   GeogGeodeticDatumGeoKey,0, 1, 32767,    // User_Defined
   GeogPrimeMeridianGeoKey,0, 1, PM_Greenwich,  // We shall assume this,
don't know how to find otherwise....
   GeogLinearUnitsGeoKey, 0, 1, Linear_Meter,  // GeogLinearUnitsGeoKey,
Linear_Meter
   GeogAngularUnitsGeoKey, 0, 1, Angular_Degree,  // GeogAngularUnitsGeoKey,
Angular_Degree
   GeogEllipsoidGeoKey, 0, 1, 32767,    // User_Defined
   GeogSemiMajorAxisGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 6,
   GeogInvFlatteningGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 7,
   ProjectedCSTypeGeoKey, 0, 1, 32767,    // User_Defined
   ProjectionGeoKey,  0, 1, 32767,    // User_Defined
   ProjCoordTransGeoKey, 0, 1, CT_TransverseMercator,
   ProjLinearUnitsGeoKey, 0, 1, Linear_Meter,
   ProjNatOriginLongGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 0,
   ProjNatOriginLatGeoKey, TIFFTAG_GEODOUBLEPARAMS, 1, 1,
   ProjCenterEastingGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 2,
   ProjCenterNorthingGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 3,
   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") );


which returns saying it detected no error. But there seems to be some kind
of size constraint as the fields :

    ProjNatOriginLongGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 0,
   ProjNatOriginLatGeoKey, TIFFTAG_GEODOUBLEPARAMS, 1, 1,
   ProjCenterEastingGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 2,
   ProjCenterNorthingGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 3,
   ProjScaleAtNatOriginGeoKey,TIFFTAG_GEODOUBLEPARAMS, 1, 4,

are not there when I do a tiff dump. If I move things around, i.e. by having
all the GEODOUBLEPARAMS entries together by moving GeogSemiMajorAxisGeoKey &
GeogInvFlatteningGeoKey to the bottom, it gets as far as
ProjCenterEastingGeoKey, two more further along than it did before!??

Has anybody come across this before. Can I split the array into two smaller
chunks and pass in one after the other, or does it have to go in as one
chunk?

Kieron



INTELLISCAN Ltd
Oldmeldrum Business Centre
Colpy Way
Oldmeldrum
Aberdeen AB51 0BZ
Web: www.intelliscan.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/geotiff/attachments/20041110/c65251c9/attachment.html


More information about the Geotiff mailing list