Set of tools to manage LandR elements. More...
#include <landr/LandRTools.hpp>
Public Types | |
enum | Relationship { NONE, INTERSECTS, CONTAINS, EQUALS, TOUCHES } |
Static Public Member Functions | |
static geos::geom::LineString * | getMergedLineStringFromGeometry (geos::geom::Geometry *Geom) |
Returns a geos::geom::LineString representing the linearized input geos::geom::Geometry. | |
static std::vector < geos::geom::LineString * > * | getMergedLineStringsFromGeometry (geos::geom::Geometry *Geom) |
Returns a vector of geos::geom::LineString representing the linearized input geos::geom::Geometry. | |
static std::vector < geos::geom::LineString * > | getVectorOfExteriorRings (openfluid::landr::VectorDataset &Val) |
Returns all exterior rings of the polygon-typed VectorDataset. | |
static std::vector < geos::geom::LineString * > | getVectorOfLines (openfluid::landr::VectorDataset &Val) |
Returns all geos::geom::LineString composing of the linestring-typed VectorDataset. | |
static std::vector < geos::geom::LineString * > * | getNodedLines (geos::geom::Geometry *Geom1, geos::geom::Geometry *Geom2, double SnapTolerance=0, double PrecisionReducer=10000000) |
Gets all full noded geos::geom::LineString from intersection between geom1 and geom2, with snap tolerance. | |
static geos::geom::Geometry * | computeSnapOverlayUnion (geos::geom::Geometry &Geom1, geos::geom::Geometry &Geom2, double SnapTolerance=0) |
Same as from geos::operation::overlay::snap::SnapOverlayOp::Union(), but with ability to use the wished snap tolerance value. | |
static bool | exists (geos::geom::LineString *Line, std::list< geos::geom::LineString * > RefLines, double Tolerance=0) |
Returns true if a geos::geom::LineString is exactly equals of an element of a list of geos::geom::LineString, up to a specified tolerance. | |
static void | polygonizeGeometry (std::vector< geos::geom::Geometry * > &Lines, std::vector< geos::geom::Polygon * > &Polygons, std::vector< const geos::geom::LineString * > &Dangles) |
Creates all possible geos::geom::Polygon from a geos::geom::Geometry. | |
static void | markVisitedNodesUsingDFS (geos::planargraph::Node *Node) |
Recursive depth first search algorithm in a LineStringGraph and mark visited Nodes. | |
static std::vector < geos::geom::Polygon * > | computeIntersectPolygons (geos::geom::Geometry *Geom1, geos::geom::Geometry *Geom2) |
Intersection of two geos::geom::Geometry of Polygons. | |
static std::vector < geos::geom::LineString * > | splitLineStringByPoint (geos::geom::LineString &Entity, geos::geom::Point &Point, double SnapTolerance) |
Splits a geos::geom::LineString by a geos::geom::Point. | |
static void | splitLineStringByPoints (geos::geom::LineString &Entity, std::vector< geos::geom::Point * > &Points, double SnapTolerance, std::vector< geos::geom::LineString * > &vLines, unsigned int step=0) |
Recursively split operation on a geos::geom::LineString by a vector of geos::geom::Point. | |
static std::vector < geos::geom::LineString * > * | cleanLineStrings (std::vector< geos::geom::LineString * > vLines, double SnapTolerance) |
Clean a vector of geos::geom::LineString (break at each intersection and remove duplicate geometry) |
Set of tools to manage LandR elements.
static std::vector<geos::geom::LineString*>* openfluid::landr::LandRTools::cleanLineStrings | ( | std::vector< geos::geom::LineString * > | vLines, |
double | SnapTolerance | ||
) | [static] |
Clean a vector of geos::geom::LineString (break at each intersection and remove duplicate geometry)
vLines | An existent vector of geos::geom::LineString. |
SnapTolerance | The tolerance to use. |
static std::vector<geos::geom::Polygon*> openfluid::landr::LandRTools::computeIntersectPolygons | ( | geos::geom::Geometry * | Geom1, |
geos::geom::Geometry * | Geom2 | ||
) | [static] |
Intersection of two geos::geom::Geometry of Polygons.
Geom1 | The geos::geom::Geometry to join with Geom2. |
Geom2 | The other geos::geom::Geometry. |
static geos::geom::Geometry* openfluid::landr::LandRTools::computeSnapOverlayUnion | ( | geos::geom::Geometry & | Geom1, |
geos::geom::Geometry & | Geom2, | ||
double | SnapTolerance = 0 |
||
) | [static] |
Same as from geos::operation::overlay::snap::SnapOverlayOp::Union(), but with ability to use the wished snap tolerance value.
Geom1 | The geos::geom::Geometry to join with Geom2. |
Geom2 | The other geos::geom::Geometry. |
SnapTolerance | The tolerance to use, default is 0. |
static bool openfluid::landr::LandRTools::exists | ( | geos::geom::LineString * | Line, |
std::list< geos::geom::LineString * > | RefLines, | ||
double | Tolerance = 0 |
||
) | [static] |
Returns true if a geos::geom::LineString is exactly equals of an element of a list of geos::geom::LineString, up to a specified tolerance.
Line | The geos::geom::LineString to compare. |
RefLines | The list of geos::geom::LineString to compare to. |
Tolerance | The tolerance to use. |
static geos::geom::LineString* openfluid::landr::LandRTools::getMergedLineStringFromGeometry | ( | geos::geom::Geometry * | Geom | ) | [static] |
Returns a geos::geom::LineString representing the linearized input geos::geom::Geometry.
Geom | The geos::geom::Geometry to linearize. |
static std::vector<geos::geom::LineString*>* openfluid::landr::LandRTools::getMergedLineStringsFromGeometry | ( | geos::geom::Geometry * | Geom | ) | [static] |
Returns a vector of geos::geom::LineString representing the linearized input geos::geom::Geometry.
Geom | The geos::geom::Geometry to linearize. |
static std::vector<geos::geom::LineString*>* openfluid::landr::LandRTools::getNodedLines | ( | geos::geom::Geometry * | Geom1, |
geos::geom::Geometry * | Geom2, | ||
double | SnapTolerance = 0 , |
||
double | PrecisionReducer = 10000000 |
||
) | [static] |
Gets all full noded geos::geom::LineString from intersection between geom1 and geom2, with snap tolerance.
Geom1 | The geos::geom::Geometry to node with Geom2. |
Geom2 | The other geos::geom::Geometry. |
SnapTolerance | The tolerance to use while computing intersections and equality of lines. |
PrecisionReducer | The PrecisionModel value for reducing coordinates precision, default is 10000000 (7 digits). |
static std::vector<geos::geom::LineString*> openfluid::landr::LandRTools::getVectorOfExteriorRings | ( | openfluid::landr::VectorDataset & | Val | ) | [static] |
Returns all exterior rings of the polygon-typed VectorDataset.
Val | A VectorDataset of polygons. |
base::OFException | if the VectorDataset is not polygon-typed. |
static std::vector<geos::geom::LineString*> openfluid::landr::LandRTools::getVectorOfLines | ( | openfluid::landr::VectorDataset & | Val | ) | [static] |
Returns all geos::geom::LineString composing of the linestring-typed VectorDataset.
Val | A VectorDataset of linestrings. |
base::OFException | if the VectorDataset is not linestring-typed. |
static void openfluid::landr::LandRTools::markVisitedNodesUsingDFS | ( | geos::planargraph::Node * | Node | ) | [static] |
Recursive depth first search algorithm in a LineStringGraph and mark visited Nodes.
Node | the begin geos::planargraph::Node of LineStringGraph |
static void openfluid::landr::LandRTools::polygonizeGeometry | ( | std::vector< geos::geom::Geometry * > & | Lines, |
std::vector< geos::geom::Polygon * > & | Polygons, | ||
std::vector< const geos::geom::LineString * > & | Dangles | ||
) | [static] |
Creates all possible geos::geom::Polygon from a geos::geom::Geometry.
Lines | The input vector of geos::geom::Geometry to polygonize. |
Polygons | The output vector of newly created geos::geom::Polygon. |
Dangles | The output vector of dangle geos::geom::LineString. |
static std::vector<geos::geom::LineString*> openfluid::landr::LandRTools::splitLineStringByPoint | ( | geos::geom::LineString & | Entity, |
geos::geom::Point & | Point, | ||
double | SnapTolerance | ||
) | [static] |
Splits a geos::geom::LineString by a geos::geom::Point.
Entity | An existent geos::geom::LineString. |
Point | A geos::geom::Point. |
SnapTolerance | The threshold distance used to find Point on Line. |
static void openfluid::landr::LandRTools::splitLineStringByPoints | ( | geos::geom::LineString & | Entity, |
std::vector< geos::geom::Point * > & | Points, | ||
double | SnapTolerance, | ||
std::vector< geos::geom::LineString * > & | vLines, | ||
unsigned int | step = 0 |
||
) | [static] |
Recursively split operation on a geos::geom::LineString by a vector of geos::geom::Point.
Entity | An existent geos::geom::LineString. |
Point | A vector of geos::geom::Point. |
SnapTolerance | The threshold distance used to find Point on Line. |
vLines | the resulting vector of geos::geom::LineString splitted. |
step | iterator of the vector of Point; default is 0. |