Geo-WKT
view release on metacpan or search on metacpan
lib/Geo/WKT.pm view on Meta::CPAN
: $_[0] =~ m/^polygon\(/i ? &parse_wkt_polygon
: $_[0] =~ m/^linestring\(/i ? &parse_wkt_linestring
: &parse_wkt_geomcol;
}
sub _list_of_points(@)
{ my @points
= @_ > 1 ? @_
: ref $_[0] eq 'ARRAY' ? @{$_[0]}
: $_[0]->isa('Math::Polygon') ? $_[0]->points
: $_[0];
my @s = map
{ (ref $_ ne 'ARRAY' && $_->isa('Geo::Point'))
? $_->x.' '.$_->y
: $_->[0].' '.$_->[1]
} @points;
local $" = ',';
"(@s)";
lib/Geo/WKT.pod view on Meta::CPAN
or multiple things.
=item B<wkt_linestring>($object|$points)
A line string is a non-closed list ('string') of points.
=item B<wkt_multilinestring>($objects|ARRAY-of-lines|ARRAYS-of-ARRAY-of-points)
Format a list of lines into WKT. A line contains Geo::Point
objects or ARRAY-REFs to coordinate pairs. You may also provide a Geo::Line
or a Math::Polygon.
=item B<wkt_multipoint>($object|$points)
A set of points, which must be specified as list. They can be stored in
a Geo::Space.
=item B<wkt_multipolygon>($objects|ARRAY-of-lines|ARRAYs-of-ARRAY-of-points)
Format a list of closed lines into WKT. A line contains Geo::Point
objects or ARRAY-REFs to coordinate pairs. You may also provide a Geo::Line
or a Math::Polygon.
=item B<wkt_optimal>($object)
Pass any Geo::Shape object, and the easiest representation is
returned.
=item B<wkt_point>( <$x,$y>|ARRAY|$geopoint )
Format one point into WKT format.
( run in 0.520 second using v1.01-cache-2.11-cpan-0a6323c29d9 )