The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Geo::Geos::Triangulate::VoronoiDiagramBuilder - Creates Voronoi Diagrams.

SYNOPSIS

    use Geo::Geos::Coordinate;
    use Geo::Geos::Triangulate::VoronoiDiagramBuilder;

    my $gf = Geo::Geos::GeometryFactory::create();
    my $c1 = Geo::Geos::Coordinate->new(1,2);
    my $c2 = Geo::Geos::Coordinate->new(5,2);
    my $c3 = Geo::Geos::Coordinate->new(5,0);
    my $c4 = Geo::Geos::Coordinate->new(1,0);

    my $coords = [$c1, $c2, $c3, $c4];

    my $env = Geo::Geos::Envelope->new(
        Geo::Geos::Coordinate->new(0,0),
        Geo::Geos::Coordinate->new(6,6),
    );
    my $tolerance = 0;

    my $builder = Geo::Geos::Triangulate::VoronoiDiagramBuilder->new($gf, $coords, $tolerance, $env);

    my $diagram = $builder->getDiagram;         # => isa 'Geo::Geos::GeometryCollection'
    my $edges   = $builder->getDiagramEdges;    # => isa 'Geo::Geos::MultiLineString'

    my $lr = $gf->createLinearRing([$c1, $c2, $c3, $c4, $c1], 2);
    my $p  = $gf->createPolygon($lr);

    my $builder1 = Geo::Geos::Triangulate::VoronoiDiagramBuilder->new($gf, $coords, $tolerance);
    my $builder2 = Geo::Geos::Triangulate::VoronoiDiagramBuilder->new($gf, $coords);
    my $builder3 = Geo::Geos::Triangulate::VoronoiDiagramBuilder->new($gf, $p);
    my $builder4 = Geo::Geos::Triangulate::VoronoiDiagramBuilder->new($gf, $p, $tolerance);
    my $builder5 = Geo::Geos::Triangulate::VoronoiDiagramBuilder->new($gf, $p, $tolerance, $env);

SEE ALSO (C++ classes docs)

GEOS C++ Library

geos::triangulate::DelaunayTriangulationBuilder

SEE ALSO

Geo::Geos

AUTHOR

Ivan Baidakou <i.baydakov@crazypanda.ru>, Crazy Panda, CP Decision LTD

LICENSE

You may distribute this code under the same terms as Perl itself.