Public Types | Static Public Member Functions | List of all members
openfluid::landr::LandRTools Class Reference

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 * computeMergedLineStringFromGeometry (geos::geom::Geometry *Geom)
 Returns a geos::geom::LineString representing the linearized input geos::geom::Geometry. More...
 
static std::vector< geos::geom::LineString * > * computeMergedLineStringsFromGeometry (geos::geom::Geometry *Geom)
 Returns a vector of geos::geom::LineString representing the linearized input geos::geom::Geometry. More...
 
static std::vector< geos::geom::LineString * > computeVectorOfExteriorRings (openfluid::landr::VectorDataset &Val)
 Returns all exterior rings of the polygon-typed VectorDataset. More...
 
static std::vector< geos::geom::LineString * > computeVectorOfLines (openfluid::landr::VectorDataset &Val)
 Returns all geos::geom::LineString composing of the linestring-typed VectorDataset. More...
 
static std::vector< geos::geom::LineString * > * computeNodedLines (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. More...
 
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. More...
 
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. More...
 
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. More...
 
static void markVisitedNodesUsingDFS (geos::planargraph::Node *Node)
 Recursive depth first search algorithm in a LineStringGraph and mark visited Nodes. More...
 
static std::vector< geos::geom::Polygon * > computeIntersectPolygons (geos::geom::Geometry *Geom1, geos::geom::Geometry *Geom2)
 Intersection of two geos::geom::Geometry of Polygons. More...
 
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. More...
 
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. More...
 
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) More...
 
static std::vector< geos::geom::Point * > computeNodesFromVectorOfLines (std::vector< geos::geom::LineString *> &NodedLines)
 Returns the nodes of a vector of geos::geom::LineString. More...
 
static void markInvertedLineStringEntityUsingDFS (geos::planargraph::Node *Node, std::vector< int > &vectIdent)
 Returns the inverted openfluid::landr::LineStringEntity of a geos::planargraph using a recursive method. More...
 
static bool isExtentsIntersect (std::vector< OGREnvelope > vEnvelope)
 Returns true if the OGREnvelope intersect, false otherwise. More...
 

Detailed Description

Set of tools to manage LandR elements.

Member Enumeration Documentation

◆ Relationship

Enumerator
NONE 
INTERSECTS 
CONTAINS 
EQUALS 
TOUCHES 

Member Function Documentation

◆ cleanLineStrings()

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)

Parameters
vLinesAn existent vector of geos::geom::LineString.
SnapToleranceThe tolerance to use.
Returns
a vector of geos::geom::LineString.

◆ computeIntersectPolygons()

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.

Parameters
Geom1The geos::geom::Geometry to join with Geom2.
Geom2The other geos::geom::Geometry.
Returns
A vector of geos::geom::Polygon representing the intersection of Geom1 and Geom2.

◆ computeMergedLineStringFromGeometry()

static geos::geom::LineString* openfluid::landr::LandRTools::computeMergedLineStringFromGeometry ( geos::geom::Geometry *  Geom)
static

Returns a geos::geom::LineString representing the linearized input geos::geom::Geometry.

Parameters
GeomThe geos::geom::Geometry to linearize.
Returns
A new allocated geos::geom::LineString representing the linearized input geos::geom::Geometry, or 0 if the geos::geom::Geometry cannot be linearized into a single geos::geom::LineString.

◆ computeMergedLineStringsFromGeometry()

static std::vector<geos::geom::LineString*>* openfluid::landr::LandRTools::computeMergedLineStringsFromGeometry ( geos::geom::Geometry *  Geom)
static

Returns a vector of geos::geom::LineString representing the linearized input geos::geom::Geometry.

Parameters
GeomThe geos::geom::Geometry to linearize.
Returns
A new allocated vector of geos::geom::LineString representing the maximal linearized input geos::geom::Geometry, or 0 if the geos::geom::Geometry is not "Line" typed.

◆ computeNodedLines()

static std::vector<geos::geom::LineString*>* openfluid::landr::LandRTools::computeNodedLines ( 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.

Parameters
Geom1The geos::geom::Geometry to node with Geom2.
Geom2The other geos::geom::Geometry.
SnapToleranceThe tolerance to use while computing intersections and equality of lines.
PrecisionReducerThe PrecisionModel value for reducing coordinates precision, default is 10000000 (7 digits).
Returns
A vector of geos::geom::LineString, representing all input lines, cut at each node.

◆ computeNodesFromVectorOfLines()

static std::vector<geos::geom::Point*> openfluid::landr::LandRTools::computeNodesFromVectorOfLines ( std::vector< geos::geom::LineString *> &  NodedLines)
static

Returns the nodes of a vector of geos::geom::LineString.

Parameters
NodedLinesA vector of geos::geom::LineString.
Returns
A vector of geos::geom::Point.

◆ computeSnapOverlayUnion()

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.

Parameters
Geom1The geos::geom::Geometry to join with Geom2.
Geom2The other geos::geom::Geometry.
SnapToleranceThe tolerance to use, default is 0.
Returns
A new geos::geom::Geometry representing the union of Geom1 and Geom2 according to SnapTolerance value.

◆ computeVectorOfExteriorRings()

static std::vector<geos::geom::LineString*> openfluid::landr::LandRTools::computeVectorOfExteriorRings ( openfluid::landr::VectorDataset Val)
static

Returns all exterior rings of the polygon-typed VectorDataset.

Parameters
ValA VectorDataset of polygons.
Returns
A vector of new allocated geos::geom::LineString representing exterior rings.
Exceptions
openfluid::base::FrameworkExceptionif the VectorDataset is not polygon-typed.

◆ computeVectorOfLines()

static std::vector<geos::geom::LineString*> openfluid::landr::LandRTools::computeVectorOfLines ( openfluid::landr::VectorDataset Val)
static

Returns all geos::geom::LineString composing of the linestring-typed VectorDataset.

Parameters
ValA VectorDataset of linestrings.
Returns
A vector of new allocated geos::geom::Geometry representing lines.
Exceptions
base::FrameworkExceptionif the VectorDataset is not linestring-typed.

◆ exists()

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.

Parameters
LineThe geos::geom::LineString to compare.
RefLinesThe list of geos::geom::LineString to compare to.
ToleranceThe tolerance to use.

◆ isExtentsIntersect()

static bool openfluid::landr::LandRTools::isExtentsIntersect ( std::vector< OGREnvelope >  vEnvelope)
static

Returns true if the OGREnvelope intersect, false otherwise.

◆ markInvertedLineStringEntityUsingDFS()

static void openfluid::landr::LandRTools::markInvertedLineStringEntityUsingDFS ( geos::planargraph::Node *  Node,
std::vector< int > &  vectIdent 
)
static

Returns the inverted openfluid::landr::LineStringEntity of a geos::planargraph using a recursive method.

Parameters
NodeA geos::planargraph::node of a geos::planargraph.
vectIdentA vector which will contain the identifier of each inverted openfluid::landr::LinestringEntity.

◆ markVisitedNodesUsingDFS()

static void openfluid::landr::LandRTools::markVisitedNodesUsingDFS ( geos::planargraph::Node *  Node)
static

Recursive depth first search algorithm in a LineStringGraph and mark visited Nodes.

Parameters
Nodethe begin geos::planargraph::Node of LineStringGraph

◆ polygonizeGeometry()

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.

Parameters
LinesThe input vector of geos::geom::Geometry to polygonize.
PolygonsThe output vector of newly created geos::geom::Polygon.
DanglesThe output vector of dangle geos::geom::LineString.

◆ splitLineStringByPoint()

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.

Parameters
EntityAn existent geos::geom::LineString.
PointA geos::geom::Point.
SnapToleranceThe threshold distance used to find Point on Line.
Returns
a vector of geos::geom::LineString, or empty vector if splitting operation is null.

◆ splitLineStringByPoints()

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.

Parameters
EntityAn existent geos::geom::LineString.
PointsA vector of geos::geom::Point.
SnapToleranceThe threshold distance used to find Point on Line.
vLinesthe resulting vector of geos::geom::LineString splitted.
stepiterator of the vector of Point; default is 0.

The documentation for this class was generated from the following file: