Geo::WKT::Simple(3pm)
π Geo::WKT::Simple π
okay bestie, so this is Geo::WKT::Simple, a lil Perl module living over in the User Contributed Perl Documentation corner of your manpages, and it's literally here to parse and build Well Known Text (WKT) format strings. pure perl data structures in, pure perl data structures out. no cap. πΊοΈβ¨
πΈ NAME πΈ
Geo::WKT::Simple β simple utils to parse/build Well Known Text(WKT) format string.
like. it does exactly what it says on the tin, bestie. π
β¨ SYNOPSIS β¨
okay so here's the whole vibe, code first:
use Geo::WKT::Simple; # Export all
or
use Geo::WKT::Simple ':parse'; # Only WKT parser functions
or
use Geo::WKT::Simple ':make'; # Only WKT builder functions
# WKT POINT
wkt_parse_point('POINT(10 20)'); #=> (10 20)
wkt_make_point(10, 20); #=> POINT(10 20)
# WKT LINESTRING
wkt_parse_linestring('LINESTRING(1 2, 3 4)'); #=> ([ 1, 2 ], [ 3, 4 ])
wkt_make_linestring([ 1, 2 ], [ 3, 4 ]); #=> LINESTRING(1 2, 3 4)
# WKT POLYGON
wkt_parse_polygon('POLYGON((1 2, 3 4, 5 6, 1 2), (1 2, 3 4, 5 6, 1 2))');
#=> (
# [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 1, 2 ] ],
# [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 1, 2 ] ],
# )
wkt_make_polygon(
[ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 1, 2 ] ],
[ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 1, 2 ] ],
); #=> 'POLYGON((1 2, 3 4, 5 6, 1 2), (1 2, 3 4, 5 6, 1 2))'
# And like so on for (MULTI)LINESTRING|POLYGON
# WKT GEOMETRYCOLLECTION
wkt_parse_geometrycollection(
'GEOMETRYCOLLECTION(POINT(10 20), LINESTRING(10 20, 30 40))'
); #=> ([ POINT => [ 10, 20 ] ], [ LINESTRING => [ [ 10, 20 ], [ 30, 40 ] ] ])
wkt_make_geometrycollection(
[ POINT => [ 10, 20 ] ], [ LINESTRING => [ [ 10, 20 ], [ 30, 40 ] ] ]
); #=> 'GEOMETRYCOLLECTION(POINT(10 20), LINESTRING(10 20, 30 40))'
# If you don't like too many exported symbols:
use Geo::WKT::Simple qw/ wkt_parse wkt_make /;
wkt_parse(POINT => 'POINT(10 20)');
wkt_make(POINT => [ 10, 20 ]);
so like. you can slurp in everything, or be a tidy lil queen and only grab ':parse' or ':make'. your call bestie. π
π DESCRIPTION π
Geo::WKT::Simple is a module to provide simple parser/builder for Well Known Text(WKT) format string.
This module can parse/build WKT format string into/from pure perl data structure.
chef's kiss. that's the whole point. no weird opaque objects, just perl data you can actually look at. π«Ά
π€ Why not Geo::WKT ?
There is few reasons. (and bestie, they're valid reasons, i'm just saying π)
- I just need simple return value represented by pure perl data structure.
Geo::WKTreturns results as aGeo::*instances which represents each type of geodetic components. Geo::Proj4dependencies.Geo::Proj4depends tolibproj4- I need to support
MULTI(LINESTRING|POLYGON).
periodt. if you wanted a whole object graph you'd have gone somewhere else. π
π FUNCTIONS π
See SYNOPSIS section for usages. (fr fr, the examples up there are doing the heavy lifting β¨)
wkt_parse_point()
Parse WKT Point string.
wkt_parse_linestring()
Parse WKT Linestring string.
wkt_parse_multilinestring()
Parse WKT MultiLinestring string.
wkt_parse_polygon()
Parse WKT Polygon string.
wkt_parse_multipolygon()
Parse WKT MultiPolygon string.
wkt_parse_geometrycollection()
Parse WKT GeometryCollection string.
wkt_parse()
Dispatch to parser which specified in first argument.
wkt_parse(POINT => 'POINT(10 20)') is equivalent to wkt_parse_point('POINT(10 20)')
wkt_make_point()
Build WKT Point string.
wkt_make_linestring()
Build WKT Linestring string.
wkt_make_multilinestring()
Build WKT MultiLinestring string.
wkt_make_polygon()
Build WKT Polygon string.
wkt_make_multipolygon()
Build WKT MultiPolygon string.
wkt_make_geometrycollection()
Build WKT GeometryCollection string.
wkt_make()
Dispatch to builder function which specified in first argument.
wkt_make(POINT => [ 10, 20 ]) is equivalent to wkt_make_point(10, 20)
the dispatchers are lowkey iconic β pass the type as the first arg and they route you to the right lil function. main character energy. π
π¦ AUTHOR π¦
Yuto KAWAMURA(kawamuray) <kawamuray.dadada {at} gmail.com>
stan. π
π« SEE ALSO π«
Geo::WKT: As same as this module except few things.- Well-known text: http://en.wikipedia.org/wiki/Well-known_text
iykyk. go read up on WKT if you want the full lore π
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
free as in bestie, go wild, just keep it Perl-flavored. π
and that's the tea π this whole page is Geo::WKT::Simple(3pm) from the User Contributed Perl Documentation, generated with perl v5.40.1 on 2025-10-01. slay, go parse some points. π
β¨πΈ
π¦ where this page comes from
- ubuntu resolute: libgeo-wkt-simple-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgeo-wkt-simple-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms