private QuadEdgeSubdivision BuildDelaunay()
 {
     var builder = new DelaunayTriangulationBuilder();
     builder.SetSites(_geom);
     var subDiv = builder.GetSubdivision();
     return subDiv;
 }
        private static void RunVoronoi(string sitesWKT, string expectedWKT)
        {
            WKTReader reader = new WKTReader();
            IGeometry sites = reader.Read(sitesWKT);

            DelaunayTriangulationBuilder builder = new DelaunayTriangulationBuilder();
            builder.SetSites(sites);

            QuadEdgeSubdivision subdiv = builder.GetSubdivision();
            IGeometry result = subdiv.GetVoronoiDiagram(GeometryFactory.Default);
            Assert.IsNotNull(result);

            IGeometry expectedEdges = reader.Read(expectedWKT);
            result.Normalize();
            expectedEdges.Normalize();
            Assert.IsTrue(expectedEdges.EqualsExact(result, ComparisonTolerance));
        }
        public void Run(int nPts)
        {
            ICollection<Coordinate> pts = RandomPoints(nPts);
            Console.WriteLine("# pts: " + pts.Count);
            Stopwatch sw = new Stopwatch();
            sw.Start();
            DelaunayTriangulationBuilder builder = new DelaunayTriangulationBuilder();
            builder.SetSites(pts);

            // don't actually form output geometry, to save time and memory
            //var g = builder.GetEdges(GeomFact);
            builder.GetSubdivision();

            Console.WriteLine("  --  Time: " + sw.ElapsedMilliseconds
                              + "  Mem: " + Memory.TotalString);
            //Console.WriteLine(g);
        }