SFCGAL 2.3.0
SFCGAL::detail::io::WkbReader Class Reference

read WKB geometry More...

#include <WkbReader.h>

Public Member Functions

 WkbReader (std::istream &wkbString, bool asHexString=false)
 read WKB from input stream
auto readWkb () -> void
 Read and parse WKB data from input stream.
auto geometry () -> std::unique_ptr< SFCGAL::Geometry >
 Returns the geometry from the (E)WKB.
auto preparedGeometry () -> std::unique_ptr< SFCGAL::PreparedGeometry >
 Returns the prepared geometry from the (E)WKB.
auto srid () const -> srid_t
 Returns the srid from the (E)WKB.

Detailed Description

read WKB geometry

Constructor & Destructor Documentation

◆ WkbReader()

SFCGAL::detail::io::WkbReader::WkbReader ( std::istream & wkbString,
bool asHexString = false )
inline

read WKB from input stream

Parameters
wkbStringhexadecimal ascii string or binary string
asHexStringif false, will read the wkb as binary string, else will read the string as hex ascii string (ie. 2 chars for 1 byte with values matching [0-9A-F]

Member Function Documentation

◆ geometry()

auto SFCGAL::detail::io::WkbReader::geometry ( ) -> std::unique_ptr< SFCGAL::Geometry >
inline

Returns the geometry from the (E)WKB.

Must be used after readWkb

Returns
Unique pointer to the parsed geometry

◆ preparedGeometry()

auto SFCGAL::detail::io::WkbReader::preparedGeometry ( ) -> std::unique_ptr< SFCGAL::PreparedGeometry >
inline

Returns the prepared geometry from the (E)WKB.

Must be used after readWkb

Returns
Unique pointer to a prepared geometry with SRID information

◆ readWkb()

auto SFCGAL::detail::io::WkbReader::readWkb ( ) -> void
inline

Read and parse WKB data from input stream.

Parses the WKB header, handles endianness, and constructs the geometry. Must be called before accessing geometry(), preparedGeometry(), or srid().

◆ srid()

auto SFCGAL::detail::io::WkbReader::srid ( ) const -> srid_t
inlinenodiscard

Returns the srid from the (E)WKB.

Must be used after readWkb

Returns
The spatial reference identifier from the WKB data