Geo-WKT
view release on metacpan or search on metacpan
lib/Geo/WKT.pod view on Meta::CPAN
print wkt_linestring($gp1, $gp2, $gp3);
# --> LINESTRING(6 7,8 9,6 9)
# Combine with Geo::Point registration of projections
my $p = parse_wkt_point "POINT(3.5 6.7)", 'wgs84';
print $p->toString; # point[wgs84](6.7000 3.5000)
=head1 DESCRIPTION
GIS application often communicate geographical structures in WKT
format, defined by the OpenGIS consortium. This module translates
Geo::Point objects from and to this WKT.
=head1 FUNCTIONS
=head2 Parsing Well Known Text format (WKT)
=over 4
=item $obj-E<gt>B<parse_wkt>( STRING, [$projection] )
Parse any STRING into the applicable Geo::Shape structure.
=item $obj-E<gt>B<parse_wkt_geomcol>( STRING, [$projection] )
Convert a WKT string into Geo::Space objects, containing
the exterior and optionally some interior polygons.
=item B<parse_wkt_linestring>( STRING, [$projection] )
Convert a WKT string into one Geo::Line object.
=item B<parse_wkt_point>( STRING, [$projection] )
Convert a WKT string into one Geo::Point object.
=item B<parse_wkt_polygon>( STRING, [$projection] )
Convert a WKT string into one Geo::Surface objects, containing
the exterior and optionally some interior polygons.
=back
=head2 Constructing Well Known Text (WKT)
=over 4
=item B<wkt_geomcollection>($objects)
Whole bunch of unsorted geometries. You may specify one Geo::Space
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.
=item B<wkt_polygon>( <LIST-of-points|Geo::Line|ARRAY-of-points> |Geo::Surface )
Format one polygon (exterior with optional interiors) into WKT format.
An ARRAY contains Geo::Point objects or ARRAY-REFs to pairs. You
may also provide a Geo::Line or Geo::Surface OBJECTS.
example:
wkt_polygon [2,3],[4,5]; #list of points for outer
wkt_polygon $gp1, $gp2; #list of Geo::Points for outer
wkt_polygon [[2,3],[4,5]]; #array of points for outer
wkt_polygon [$gp1, $gp2]; #array with Geo::Points for outer
my $outer = Geo::Line->new;
wkt_polygon $outer;
wkt_polygon $outer, $inner1, $inner2;
wkt_polygon [$gp1,$gp2],[$gp3,$gp4,...];
=back
=head1 SEE ALSO
This module is part of Geo-WKT distribution version 0.96,
built on January 23, 2018. Website: F<http://perl.overmeer.net/CPAN/>
=head1 LICENSE
Copyrights 2008-2018 by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://dev.perl.org/licenses/>
( run in 0.614 second using v1.01-cache-2.11-cpan-f56aa216473 )