ThinkGeo.com    |     Documentation    |     Premium Support

The decimal degree latitude value you provided was out of range

Hi,

I have a problem computing a big distance such as the one bellow. What did I do wrong ?

Thanks, Judicael.

BaseShape point1 = new PointShape(44.8, -0.6);
BaseShape point2 = new PointShape(23.3, 120.3);
var distance = point1.GetDistanceTo(point2, GeographyUnit.DecimalDegree, DistanceUnit.Meter);

System.ArgumentOutOfRangeException: The decimal degree latitude value you provided was out of range.
Parameter name: toPoint.Y

Found my error, I just invert lat and lon. The error message was clear enough ! Hope it might help someone someday :wink:

Hi judicael_ribault,

Thanks for your share, that should be helpful if someone else find your topic if they met same problem.

Regards,

Ethan