Geo::Geos::Polygon - Represents a linear polygon, which may include holes.
use Geo::Geos::Coordinate; use Geo::Geos::GeometryFactory; 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 $lr = $gf->createLinearRing([$c1, $c2, $c3, $c4, $c1], 2); ok $lr; my $p = $gf->createPolygon($lr); # => isa 'Geo::Geos::Polygon' $gf->createPolygon($lr); # => isa 'Geo::Geos::Polygonal' $p->getNumInteriorRing; # => 1; $p->getInteriorRingN(0); # => isa 'Geo::Geos::LinearRing' $p->getExteriorRing; # => isa 'Geo::Geos::LinearRing'
See methods in the base class Geo::Geos::Geometry.
GEOS C++ Library
geos::geom::Polygon
Geo::Geos
Geo::Geos::Geometry
Geo::Geos::GeometryFactory
Geo::Geos::LinearRing
Ivan Baidakou <i.baydakov@crazypanda.ru>, Crazy Panda, CP Decision LTD
You may distribute this code under the same terms as Perl itself.
To install Geo::Geos, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Geos
CPAN shell
perl -MCPAN -e shell install Geo::Geos
For more information on module installation, please visit the detailed CPAN module installation guide.