示例#1
0
        public static Geometry voronoiDiagramWithData(Geometry geom, Geometry g2)
        {
            GeometryDataUtil.setComponentDataToIndex(geom);

            var mapper = new VertexTaggedGeometryDataMapper();

            mapper.LoadSourceGeometries(geom);

            var builder = new VoronoiDiagramBuilder();

            builder.SetSites(mapper.Coordinates);
            if (g2 != null)
            {
                builder.ClipEnvelope = g2.EnvelopeInternal;
            }
            builder.Tolerance = TRIANGULATION_TOLERANCE;
            Geometry diagram = builder.GetDiagram(geom.Factory);

            mapper.TransferData(diagram);
            return(diagram);
        }
        public static IGeometry VoronoiDiagramWithData(IGeometry geom, IGeometry g2)
        {
            GeometryDataUtil.SetComponentDataToIndex(geom);

            VertexTaggedGeometryDataMapper mapper = new VertexTaggedGeometryDataMapper();

            mapper.LoadSourceGeometries(geom);

            VoronoiDiagramBuilder builder = new VoronoiDiagramBuilder();

            builder.SetSites(mapper.Coordinates);
            if (g2 != null)
            {
                builder.ClipEnvelope = g2.EnvelopeInternal;
            }
            builder.Tolerance = TriangulationTolerance;
            IGeometry diagram = builder.GetDiagram(geom.Factory);

            mapper.TransferData(diagram);
            return(diagram);
        }