All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 * getMergedLineStringFromGeometry (geos::geom::Geometry *Geom)
 Returns a geos::geom::LineString representing the linearized input geos::geom::Geometry. More...
 
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. More...
 
static std::vector
< geos::geom::LineString * > 
getVectorOfExteriorRings (openfluid::landr::VectorDataset &Val)
 Returns all exterior rings of the polygon-typed VectorDataset. More...
 
static std::vector
< geos::geom::LineString * > 
getVectorOfLines (openfluid::landr::VectorDataset &Val)
 Returns all geos::geom::LineString composing of the linestring-typed VectorDataset. More...
 
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. 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 * > 
getNodesFromVectorOfLines (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...
 

Detailed Description

Set of tools to manage LandR elements.

Member Enumeration Documentation

Enumerator
NONE 
INTERSECTS 
CONTAINS 
EQUALS 
TOUCHES 

Member Function Documentation

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

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

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

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.
static std::vector<geos::geom::Point*> openfluid::landr::LandRTools::getNodesFromVectorOfLines ( 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.
static std::vector<geos::geom::LineString*> openfluid::landr::LandRTools::getVectorOfExteriorRings ( 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
base::OFExceptionif 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.

Parameters
ValA VectorDataset of linestrings.
Returns
A vector of new allocated geos::geom::Geometry representing lines.
Exceptions
base::OFExceptionif the VectorDataset is not linestring-typed.
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.
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
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.
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.
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: