minneyar

Bug in esri.geometry.geometricDensify in 2.2?

Discussion created by minneyar on Apr 27, 2011
Latest reply on Jun 1, 2011 by Jian
This function seems to fail sometimes for points that are very far apart (20,000 km or so -- I'm not sure exactly where the error happens).  Instead of returning a Polyline that is broken up into lots of little segments, it returns a Polyline with two points, one of which is the original start point and the second of which is NaN,NaN.  For example, try this:

var pline = new esri.geometry.Polyline();
pline.addPath([[-48.6, 39.4], [130.9, -39.3]]);
var result = esri.geometry.geodesicDensify(pline, 10000);
if( isNaN( result.paths[0][1][0] ) ) {
    alert("It's a bug!");
}


Changing the distance by even a short amount seems to work perfectly -- for example, replace the -48.6 above with a -48.5, and it runs just fine.  I've tested it in Firefox 4.0 and Chromium 12.0.747.0 in Ubuntu Linux 10.10, and it behaves exactly the same way in both browsers.

Does anybody else see this?  Anybody know what's going wrong?

Outcomes