<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY 
style="BACKGROUND-POSITION: left bottom; FONT-WEIGHT: normal; FONT-SIZE: 10pt; BACKGROUND-IMAGE: url(http://skins.hotbar.com/skins/mailskins/st/010602/010602water8_1.jpg); MARGIN: 3px 0px 180px 6px; COLOR: #002c5a; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: Arial; BACKGROUND-COLOR: #ffffff" 
bgColor=#ffffff stationery_tag_mark hbtype="st" hmark="hotbar_element">
<DIV><SPAN class=542065913-10112004>Hi All,</SPAN></DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004>Well, worked out the things I need to put in 
to create a custom datum (I think!) with kind help from Frank 
Warmerdam.</SPAN></DIV>
<DIV><SPAN class=542065913-10112004>How</SPAN><SPAN 
class=542065913-10112004>ever I've got a strange one, I pass the following array 
in to the libtiff library, </SPAN></DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004>
<DIV><SPAN class=542065913-10112004>unsigned short GeoKeyDirectory[] = 
<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,&nbsp;2,&nbsp;15,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 
1 - version 1, revision 1.2,&nbsp; 3 keys 
defined<BR>&nbsp;&nbsp;&nbsp;GTModelTypeGeoKey,&nbsp;&nbsp;0,&nbsp;1,&nbsp;ModelTypeProjected,<BR>&nbsp;&nbsp;&nbsp;GTRasterTypeGeoKey,&nbsp;&nbsp;0,&nbsp;1,&nbsp;RasterPixelIsArea,<BR>&nbsp;&nbsp;&nbsp;GTCitationGeoKey,&nbsp;&nbsp;TIFFTAG_GEOASCIIPARAMS,&nbsp;20,&nbsp;0,<BR>&nbsp;&nbsp;&nbsp;GeographicTypeGeoKey,&nbsp;0,&nbsp;1,&nbsp;32767,&nbsp;&nbsp;&nbsp;&nbsp;// 
User_Defined<BR>&nbsp;&nbsp;&nbsp;GeogGeodeticDatumGeoKey,0,&nbsp;1,&nbsp;32767,&nbsp;&nbsp;&nbsp;&nbsp;// 
User_Defined<BR>&nbsp;&nbsp;&nbsp;GeogPrimeMeridianGeoKey,0,&nbsp;1,&nbsp;PM_Greenwich,&nbsp;&nbsp;// 
We shall assume this, don't know how to find 
otherwise....<BR>&nbsp;&nbsp;&nbsp;GeogLinearUnitsGeoKey,&nbsp;0,&nbsp;1,&nbsp;Linear_Meter,&nbsp;&nbsp;// 
GeogLinearUnitsGeoKey, 
Linear_Meter<BR>&nbsp;&nbsp;&nbsp;GeogAngularUnitsGeoKey,&nbsp;0,&nbsp;1,&nbsp;Angular_Degree,&nbsp;&nbsp;// 
GeogAngularUnitsGeoKey, 
Angular_Degree<BR>&nbsp;&nbsp;&nbsp;GeogEllipsoidGeoKey,&nbsp;0,&nbsp;1,&nbsp;32767,&nbsp;&nbsp;&nbsp;&nbsp;// 
User_Defined<BR>&nbsp;&nbsp;&nbsp;GeogSemiMajorAxisGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;6,&nbsp;<BR>&nbsp;&nbsp;&nbsp;GeogInvFlatteningGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;7,<BR>&nbsp;&nbsp;&nbsp;ProjectedCSTypeGeoKey,&nbsp;0,&nbsp;1,&nbsp;32767,&nbsp;&nbsp;&nbsp;&nbsp;// 
User_Defined<BR>&nbsp;&nbsp;&nbsp;ProjectionGeoKey,&nbsp;&nbsp;0,&nbsp;1,&nbsp;32767,&nbsp;&nbsp;&nbsp;&nbsp;// 
User_Defined<BR>&nbsp;&nbsp;&nbsp;ProjCoordTransGeoKey,&nbsp;0,&nbsp;1,&nbsp;CT_TransverseMercator,<BR>&nbsp;&nbsp;&nbsp;ProjLinearUnitsGeoKey,&nbsp;0,&nbsp;1,&nbsp;Linear_Meter,<BR>&nbsp;&nbsp;&nbsp;ProjNatOriginLongGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;0,<BR>&nbsp;&nbsp;&nbsp;ProjNatOriginLatGeoKey,&nbsp;TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;1,<BR>&nbsp;&nbsp;&nbsp;ProjCenterEastingGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;2,<BR>&nbsp;&nbsp;&nbsp;ProjCenterNorthingGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;3,<BR>&nbsp;&nbsp;&nbsp;ProjScaleAtNatOriginGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;4,<BR>&nbsp;//&nbsp;&nbsp;ProjStdParallel1GeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;&nbsp;1,&nbsp;5,<BR>&nbsp;&nbsp;&nbsp;0,0,0,0<BR>&nbsp;&nbsp;};</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004>&nbsp;&nbsp;TiffError = TIFFSetField( 
m_pTiff, TIFFTAG_GEOKEYDIRECTORY, sizeof( GeoKeyDirectory ), GeoKeyDirectory 
);<BR>&nbsp;&nbsp;ok &amp;= TestTiffError( TiffError, 
_T("TIFFTAG_GEOKEYDIRECTORY") );</SPAN></DIV></SPAN></DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004>which returns saying it detected no error. 
But there seems to be some kind of size constraint as the fields :</SPAN></DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004>&nbsp;&nbsp;&nbsp; 
ProjNatOriginLongGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;0,<BR>&nbsp;&nbsp;&nbsp;ProjNatOriginLatGeoKey,&nbsp;TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;1,<BR>&nbsp;&nbsp;&nbsp;ProjCenterEastingGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;2,<BR>&nbsp;&nbsp;&nbsp;ProjCenterNorthingGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;3,<BR>&nbsp;&nbsp;&nbsp;ProjScaleAtNatOriginGeoKey,TIFFTAG_GEODOUBLEPARAMS,&nbsp;1,&nbsp;4,<BR></SPAN></DIV>
<DIV><SPAN class=542065913-10112004>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 &amp; GeogInvFlatteningGeoKey to the bottom, it 
gets as far as ProjCenterEastingGeoKey, two more further along than it did 
before!??</SPAN></DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004>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?</SPAN></DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004>Kieron</DIV></SPAN>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV><SPAN class=542065913-10112004></SPAN>&nbsp;</DIV>
<DIV>
<DIV>INTELLISCAN Ltd<BR>Oldmeldrum Business Centre<BR>Colpy 
Way<BR>Oldmeldrum<BR>Aberdeen AB51 0BZ<BR>Web: <A 
href="http://www.intelliscan.co.uk/">www.intelliscan.co.uk</A></DIV><EMBED_ST 
id=stationeryFile widh="0" height="0" 
embed_src="C:\\Documents and Settings\\Ioannis\\Application Data\\Hotbar\\eskin\\010602water8_st.htm"></DIV><!--mail_content--><SPAN 
id=hotbar_element_used stationery_tag_mark></SPAN></BODY></HTML>