SFCGAL  2.3.0
Public Member Functions | List of all members
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 More...
 
auto readWkb () -> void
 Read and parse WKB data from input stream. More...
 
auto geometry () -> std::unique_ptr< SFCGAL::Geometry >
 Returns the geometry from the (E)WKB. More...
 
auto preparedGeometry () -> std::unique_ptr< SFCGAL::PreparedGeometry >
 Returns the prepared geometry from the (E)WKB. More...
 
auto srid () const -> srid_t
 Returns the srid from the (E)WKB. More...
 

Detailed Description

read WKB geometry

Constructor & Destructor Documentation

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

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
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
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().

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

Returns the srid from the (E)WKB.

Must be used after readWkb

Returns
The spatial reference identifier from the WKB data