<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Sorry &#8211; left critical line out of previous post. Is there a web based version of this mailing list? It&#8217;s a bit tedious with mailman.</span><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Can anybody see what I&#8217;m doing wrong (and don&#8217;t say writing it in VB.NET) in my logic of converting a Lat/Long to UTM?<span style='color:#1F497D'> All the assignments, except the lat one, are successful</span><o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; <span style='color:blue'>Dim</span> MapSRS <span style='color:blue'>As</span> <span style='color:blue'>New</span> <span style='color:#2B91AF'>OGRSpatialReference</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>' Coordinate system of map</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; <span style='color:blue'>Dim</span> UTMSRS <span style='color:blue'>As</span> <span style='color:blue'>New</span> <span style='color:#2B91AF'>OGRSpatialReference</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>' Coordinate system for UTM</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; <span style='color:blue'>Dim</span> CT <span style='color:blue'>As</span> <span style='color:#2B91AF'>OGRCoordinateTransformation</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>' Coordinate transform from map to UTM<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; <span style='color:blue'>Dim</span> GDALError <span style='color:blue'>As</span> <span style='color:#2B91AF'>NCSError<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; GDALError = WGS84SRS.SetWellKnownGeogCS(<span style='color:#A31515'>&quot;WGS84&quot;</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>' Define WGS84 coordinate system</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; GDALError = UTMSRS.SetWellKnownGeogCS(<span style='color:#A31515'>&quot;WGS84&quot;</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>' Define a UTM coordinate system<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; GDALError = MapSRS.ImportFromEPSG(3517)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;GDALError = UTMSRS.SetUTM(55, false)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; CT = CreateCoordinateTransformation(MapSRS, UTMSRS)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>' Create a coordinate transformation<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; UTMeast = cursor.X : UTMnorth = cursor.Y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216; cursor.X = Lon; cursor.Y = Lat<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>&nbsp;&nbsp; Success = CT.TransformPoint(UTMeast, UTMnorth, 0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>' Transform the point<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:green'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal>Success returns false, and UTMeast = -505516.60123597935 and UTMnorth = 9999959.7180830985<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>_______________________________________<o:p></o:p></p><p class=MsoNormal>Marc Hillman, Melbourne, Australia<o:p></o:p></p><p class=MsoNormal><a href="http://users.tpg.com.au/users/mhillman/">http://users.tpg.com.au/users/mhillman/</a><o:p></o:p></p><p class=MsoNormal>marc .hillman @ t p g . c o m . a u<o:p></o:p></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Eagles may soar, but weasels don't get sucked into jet engines.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Early bird gets the worm, but the second mouse gets the cheese.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>If Barbie is so popular, why do you have to buy her friends?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>All those who believe in psychokinesis, raise my hand.<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>