Problem while computing area of a polygon

Jul 23, 2012 at 10:57 AM


            Random rnd = new Random();
            Coordinate[] c = new Coordinate[3];
            for (int i = 0; i < 2; i++)
            {
                c[i] = new Coordinate((rnd.NextDouble() * 360) - 180, (rnd.NextDouble() * 180) - 90);
            }
            c[2] = c[0];
            var polygon = new DotSpatial.Topology.Polygon(c);
            var length = polygon.Length;
            var area = polygon.Area;

Area value is zero in all cases

How to compute area of polygon?

Developer
Jul 23, 2012 at 7:18 PM

Again, see http://dotspatial.codeplex.com/discussions/387421

Jul 24, 2012 at 5:02 AM

Thanks... It worked