[gdal-dev] TransformPoint returning Infinity

Henneke, Amanda M amanda.m.henneke at boeing.com
Tue Oct 20 09:02:39 EDT 2009


Hello all-

I've been running into a problem where I'm trying to transform points into UTM NAD83 and occasionally (does not seem to be repeatable, more random) the TransformPoint method returns Infinity for the x and y coordinate.  Just for your info, the coordinate system I'm converting from is UTM NAD27.  Anyone else seen this?  I've included my code below...am I doing something wrong or is there some sort of an issue with the TransformPont method?

// Get the input layer's spatial reference information
OSGeo.OSR.SpatialReference sr = lyrOriginal.GetSpatialRef();
string sSpRefWKT = "";

// If this is a valid spatial reference, then export the data to a string and return it
if (Validator.IsValid_SpatialRef(sr))
{
        sr.ExportToPrettyWkt(out sSpRefWKT, 1);
}
sr.Dispose();

OSGeo.OSR.SpatialReference srOld = new OSGeo.OSR.SpatialReference(sSpRefParams);
OSGeo.OSR.SpatialReference srNew = new OSGeo.OSR.SpatialReference("");

srNew.SetUTM(11, 1);
srNew.SetWellKnownGeogCS("NAD83");

ctTransform = new OSGeo.OSR.CoordinateTransformation(srOld, srNew);

double[] dLnSegPt1 = { dX1, dY1 };
ctTransform.TransformPoint(dLnSegPt1);

Thanks,
Amanda

Amanda M. Henneke



When One tugs at a single thing in Nature, he finds it attached to the rest of the world. -John Muir
  Please consider the environment before printing this e-mail.




More information about the gdal-dev mailing list