Can anybody see what I'm doing wrong (and don't say writing it in VB.NET) in
my logic of converting a Lat/Long to UTM?

 

   Dim MapSRS As New OGRSpatialReference       ' Coordinate system of map

   Dim UTMSRS As New OGRSpatialReference       ' Coordinate system for UTM

   Dim CT As OGRCoordinateTransformation       ' Coordinate transform from
map to UTM

   Dim GDALError As NCSError

 

   GDALError = WGS84SRS.SetWellKnownGeogCS("WGS84")          ' Define WGS84
coordinate system

   GDALError = UTMSRS.SetWellKnownGeogCS("WGS84")              ' Define a
UTM coordinate system

   

   GDALError = UTMSRS.SetUTM(55, false)

   CT = CreateCoordinateTransformation(MapSRS, UTMSRS)        ' Create a
coordinate transformation

 

   UTMeast = cursor.X : UTMnorth = cursor.Y            ' cursor.X = Lon;
cursor.Y = Lat

   Success = CT.TransformPoint(UTMeast, UTMnorth, 0)           ' Transform
the point

 

Success returns false, and UTMeast = -505516.60123597935 and UTMnorth =
9999959.7180830985

 

_______________________________________

Marc Hillman, Melbourne, Australia

 <http://users.tpg.com.au/users/mhillman/>
http://users.tpg.com.au/users/mhillman/

marc .hillman @ t p g . c o m . a u

Eagles may soar, but weasels don't get sucked into jet engines.

Early bird gets the worm, but the second mouse gets the cheese.

If Barbie is so popular, why do you have to buy her friends?

All those who believe in psychokinesis, raise my hand.

 

_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to