Bear with me, I am a developer who just recently started working with a GIS API. I also looked at this thread but that didnt help at all even though the problem seems similar.I am using version 3.0 of the Silverlight API:I am trying to get the area of a polygon. In our software there is already functionality to get the perimeter/length in feet, which appears to be working correctly: //converts points to WGS84 (WKID=4326) and then does math on converted points private double CalcWorldLength(MapPoint pt1, MapPoint pt2) { WebMercator web = new WebMercator(); MapPoint wgsPt1 = (MapPoint)web.ToGeographic(pt1); MapPoint wgsPt2 = (MapPoint)web.ToGeographic(pt2); double[] ppt1 = ProjectPoint(wgsPt1.X, wgsPt1.Y); double[] ppt2 = ProjectPoint(wgsPt2.X, wgsPt2.Y); double ret = Math.Round(Math.Abs(Math.Pow((Math.Pow((ppt2[0] - ppt1[0]), 2) + Math.Pow((ppt2[1] - ppt1[1]), 2)), .5))); return ret; }
I am trying to add functionality to get the area of a polygon, but I routinely get incorrect values for the area, and even length. I have tried getting the area and length by incorporating the example Area and Perimeter:geometryService.AreasAndLengthsAsync(graphicList, ESRI.ArcGIS.Client.Tasks.LinearUnit.Foot, ESRI.ArcGIS.Client.Tasks.LinearUnit.Foot,CalculationType.Geodesic);
but I found that the answer is consistently off in both area and length by a particular ratio (unit values being returned are always ~1.35x bigger than they should be).I also tried using the function "ESRI.ArcGIS.Client.Geometry.Euclidian.Area", but I keep getting back relatively small or negative numbers. I am passing the function a polygon in the spatial Reference of 4326 (WKID).Any ideas?