Shapes
GIS made easy, a lightweight header-only planar geometry library for Modern C++
|
Base class for all geometries. More...
#include <geometry.hpp>
Public Member Functions | |
geometry_type | geom_type () const noexcept |
Returns the geometry type. More... | |
std::string | tagged_text () const noexcept |
Returns the geometry type as a string. More... | |
dimension_type | dim () const noexcept |
Returns the dimension type for the geometry. More... | |
size_t | ndim () const noexcept |
Returns the number of dimensions of the geometry. More... | |
void | throw_for_invalid () const |
Raise an error if the geometry is invalid. More... | |
bool | is_closed () const noexcept |
Whether the geometry is closed. More... | |
bool | is_valid () const noexcept |
Whether the geometry is valid. More... | |
bounds_t | bounds () const |
Returns the bounding box of the geometry. More... | |
bool | has_z () const noexcept |
Whether the geometry has the z-coordinate. More... | |
bool | has_m () const noexcept |
Whether the geometry has the m-coordinate (measurement coordinate) More... | |
std::string | json (std::int32_t precision=-1) const |
Dumps the geojson representation of the geometry. More... | |
std::string | wkt (std::int32_t precision=-1) const |
Dumps the wkt representation of the geometry. More... | |
Static Public Member Functions | |
static T | from_json (const std::string &json) |
Creates a geometry from a geojson string. More... | |
static T | from_wkt (const std::string &wkt) |
Creates a Geometry from a wkt string. More... | |
Base class for all geometries.
T | the geometry type (e.g. Point, Polygon, LineString) |
Definition at line 26 of file geometry.hpp.
|
inline |
Returns the bounding box of the geometry.
Definition at line 203 of file geometry.hpp.
|
inlinenoexcept |
Returns the dimension type for the geometry.
Definition at line 117 of file geometry.hpp.
|
inlinestatic |
Creates a geometry from a geojson string.
json | the geojson string |
Definition at line 242 of file geometry.hpp.
|
inlinestatic |
Creates a Geometry from a wkt string.
wkt | the wkt string |
Definition at line 270 of file geometry.hpp.
|
inlinenoexcept |
Returns the geometry type.
Definition at line 35 of file geometry.hpp.
|
inlinenoexcept |
Whether the geometry has the m-coordinate (measurement coordinate)
Definition at line 226 of file geometry.hpp.
|
inlinenoexcept |
Whether the geometry has the z-coordinate.
Definition at line 214 of file geometry.hpp.
|
inlinenoexcept |
Whether the geometry is closed.
Definition at line 173 of file geometry.hpp.
|
inlinenoexcept |
Whether the geometry is valid.
Definition at line 184 of file geometry.hpp.
|
inline |
Dumps the geojson representation of the geometry.
precision | the output precision |
Definition at line 255 of file geometry.hpp.
|
inlinenoexcept |
Returns the number of dimensions of the geometry.
Definition at line 142 of file geometry.hpp.
|
inlinenoexcept |
Returns the geometry type as a string.
Definition at line 46 of file geometry.hpp.
|
inline |
Raise an error if the geometry is invalid.
geometry_error | the geometry error |
Definition at line 162 of file geometry.hpp.
|
inline |
Dumps the wkt representation of the geometry.
precision | the output precision |
Definition at line 283 of file geometry.hpp.