NAME

Geo::Geos::WKBReader - Reads a Geometry from Well-Known Binary format.

SYNOPSIS

    use Geo::Geos::GeometryFactory;
    use Geo::Geos::PrecisionModel qw/TYPE_FLOATING/;
    use Geo::Geos::WKBReader;
    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;
    my $w = Geo::Geos::WKBWriter->new($dimensions, TYPE_BYTEORDER_BE, $include_SRID);
    my $s1 = $w->write($p);
    my $s2 = $w->writeHEX($p);

    Geo::Geos::WKBReader::read($s1, $gf);       # => isa 'Geo::Geos::Geometry'
    Geo::Geos::WKBReader::read($s1, $gf);       # => isa 'Geo::Geos::Point'
    Geo::Geos::WKBReader::readHEX($s2, $gf);    # => isa 'Geo::Geos::Geometry'
    Geo::Geos::WKBReader::readHEX($s2, $gf);    # => isa 'Geo::Geos::Point'

    my $g = Geo::Geos::WKBReader::readHEX($s2, $gf);
    $g->compareTo($p);      # => 0

SEE ALSO (C++ classes docs)

GEOS C++ Library

geos::io::WKBReader

Geo::Geos

Geo::Geos::Geometry

Geo::Geos::WKBConstants

Geo::Geos::WKBWriter

AUTHOR

Ivan Baidakou <i.baydakov@crazypanda.ru>, Crazy Panda, CP Decision LTD

LICENSE

You may distribute this code under the same terms as Perl itself.