Geo::Geos::WKBWriter - Writes a Geometry into Well-Known Binary format.
use Geo::Geos::GeometryFactory; use Geo::Geos::PrecisionModel qw/TYPE_FLOATING/; use Geo::Geos::WKBWriter; use Geo::Geos::WKBConstants qw/TYPE_BYTEORDER_BE/; my $pm = Geo::Geos::PrecisionModel->new(TYPE_FLOATING); my $gf = Geo::Geos::GeometryFactory::create($pm, 3857); my $c = Geo::Geos::Coordinate->new(1,2); my $p = $gf->createPoint($c); my $dimensions = 2; my $include_SRID = 1; Geo::Geos::WKBWriter->new($dimensions, TYPE_BYTEORDER_BE, $include_SRID); # => isa 'Geo::Geos::WKBWriter' Geo::Geos::WKBWriter->new($dimensions, TYPE_BYTEORDER_BE); # => isa 'Geo::Geos::WKBWriter' Geo::Geos::WKBWriter->new($dimensions); # => isa 'Geo::Geos::WKBWriter' Geo::Geos::WKBWriter->new(); # => isa 'Geo::Geos::WKBWriter' my $w = Geo::Geos::WKBWriter->new($dimensions, TYPE_BYTEORDER_BE, $include_SRID); $w->setOutputDimension(2); $w->getOutputDimension; # => 2 $w->setByteOrder(TYPE_BYTEORDER_BE); $w->getByteOrder; # => TYPE_BYTEORDER_BE $w->setIncludeSRID(1); $w->getIncludeSRID; # => success $w->write($p); $w->writeHEX($p);
GEOS C++ Library
geos::io::WKBWriter
Geo::Geos
Geo::Geos::Geometry
Geo::Geos::WKBConstants
Geo::Geos::WKBReader
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.