All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions
openfluid::landr::LineStringGraph Class Reference

A LandRGraph composed of LineStringEntities. More...

#include <landr/LineStringGraph.hpp>

Inheritance diagram for openfluid::landr::LineStringGraph:
openfluid::landr::LandRGraph

List of all members.

Public Member Functions

virtual ~LineStringGraph ()
LandRGraph::GraphType getType ()
 Returns the type of graph.
LineStringEntitygetEntity (int OfldId)
 Returns a LineStringEntity with OFLD_ID, or 0 if it doesn't exist.
virtual void removeEntity (int OfldId)
 Removes from this LineStringGraph the LineStringEntity with OFLD_ID and its associated nodes.
LineStringEntitygetLastLineStringEntity ()
 Returns the last LineStringEntity of this LineStringGraph, according to the LineStringEntity orientations, ie the one that has no down neighbour.
std::vector< LineStringEntity * > getEndLineStringEntities ()
 Returns a vector of LineStringEntity that have no down neighbour, according to the LineStringEntity orientations.
std::vector< LineStringEntity * > getStartLineStringEntities ()
 Returns a vector of LineStringEntity that have no up neighbour, according to the LineStringEntity orientations.
float * getRasterValueForEntityStartNode (LineStringEntity &Entity)
 Fetch the associated raster value corresponding to the LineStringEntity StartNode coordinate.
float * getRasterValueForEntityEndNode (LineStringEntity &Entity)
 Fetch the associated raster value corresponding to the LineStringEntity EndNode coordinate.
void setAttributeFromRasterValueAtStartNode (const std::string &AttributeName)
 Creates a new attribute for these LineStringGraph entities, and set for each LineStringEntity this attribute value as the associated raster values corresponding to the StartNode LineStringEntity coordinates.
void setAttributeFromRasterValueAtEndNode (const std::string &AttributeName)
 Creates a new attribute for these LineStringGraph entities, and set for each LineStringEntity this attribute value as the associated raster values corresponding to the EndNode LineStringEntity coordinates.
void reverseLineStringEntity (LineStringEntity &Entity)
 Reverse a LineStringEntity orientation.
bool isLineStringGraphArborescence ()
 Returns true if this LineStringGraph is an arborescence, false otherwise.
virtual void setAttributeFromMeanRasterValues (const std::string &AttributeName)
 Creates a new attribute for this LineStringGraph entities, and set for each LineStringEntity this attribute value as the mean of the StartNode altitude and the EndNode altitude.
virtual void setAttributeFromVectorLocation (const std::string &AttributeName, openfluid::core::GeoVectorValue &Vector, const std::string &Column, double Thresh=0.0001)
 Creates a new attribute for this LineStringGraph entities, and set for each LineStringEntity this attribute value as the vector value corresponding to the Vector Entity Geometry.
virtual void setAttributeFromVectorLocation (const std::string &AttributeName, openfluid::landr::VectorDataset &Vector, const std::string &Column, double Thresh=0.0001)
 Creates a new attribute for this LineStringGraph entities, and set for each LineStringEntity. this attribute value as the vector value corresponding to the Vector Entity Geometry.
void mergeLineStringEntities (LineStringEntity &Entity, LineStringEntity &EntityToMerge)
 Merges a LineStringEntity into an other one.
std::multimap< double,
LineStringEntity * > 
getLineStringEntitiesByMinLength (double MinLength, bool rmDangle=true)
 Gets a map of small LineStringEntity under length threshold and only if the LineStringEntity is not between two confluences.

Static Public Member Functions

static LineStringGraphcreate (openfluid::core::GeoVectorValue &Val)
 Creates a new LineStringGraph initialized from a core::GeoVectorValue.
static LineStringGraphcreate (openfluid::landr::VectorDataset &Vect)
 Creates a new LineStringGraph initialized from a VectorDataset.
static LineStringGraphcreate (const LandRGraph::Entities_t &Entities)
 Creates a new LineStringGraph initialized with a list of LandREntity.

Protected Member Functions

 LineStringGraph ()
 LineStringGraph (openfluid::core::GeoVectorValue &Val)
 Creates a new LineStringGraph initialized from a core::GeoVectorValue.
 LineStringGraph (openfluid::landr::VectorDataset &Vect)
 Creates a new LineStringGraph initialized from a VectorDataset.
virtual void addEntity (LandREntity *Entity)
 Adds a LandREntity into this LineStringGraph.
virtual LandREntitygetNewEntity (const geos::geom::Geometry *Geom, unsigned int OfldId)
 Creates a new LineStringEntity.

Detailed Description

A LandRGraph composed of LineStringEntities.


Constructor & Destructor Documentation

openfluid::landr::LineStringGraph::LineStringGraph ( ) [protected]
openfluid::landr::LineStringGraph::LineStringGraph ( openfluid::core::GeoVectorValue Val) [protected]

Creates a new LineStringGraph initialized from a core::GeoVectorValue.

openfluid::landr::LineStringGraph::LineStringGraph ( openfluid::landr::VectorDataset Vect) [protected]

Creates a new LineStringGraph initialized from a VectorDataset.


Member Function Documentation

virtual void openfluid::landr::LineStringGraph::addEntity ( LandREntity Entity) [protected, virtual]

Creates a new LineStringGraph initialized from a core::GeoVectorValue.

Parameters:
ValA core::GeoVectorValue which must be composed of one or many LineStrings, and each of them must contain a "OFLD_ID" attribute.

Creates a new LineStringGraph initialized from a VectorDataset.

Parameters:
VectA VectorDataset which must be composed of one or many LineStrings, and each of them must contain a "OFLD_ID" attribute.

Creates a new LineStringGraph initialized with a list of LandREntity.

Parameters:
EntitiesA list of LandREntity which must be LineStringEntity.

Returns a vector of LineStringEntity that have no down neighbour, according to the LineStringEntity orientations.

Returns a LineStringEntity with OFLD_ID, or 0 if it doesn't exist.

Reimplemented from openfluid::landr::LandRGraph.

Returns the last LineStringEntity of this LineStringGraph, according to the LineStringEntity orientations, ie the one that has no down neighbour.

Returns:
The last LineStringEntity or 0 if there is zero or more than one LineStringEntity whith no down neighbour.
std::multimap<double, LineStringEntity*> openfluid::landr::LineStringGraph::getLineStringEntitiesByMinLength ( double  MinLength,
bool  rmDangle = true 
)

Gets a map of small LineStringEntity under length threshold and only if the LineStringEntity is not between two confluences.

Parameters:
MinLengthThe length threshold (in map units).
rmDangle: if true, get also dangles under the threshold.
Returns:
a multimap of LineStringEntity with key is the length of each LineStringEntity.
virtual LandREntity* openfluid::landr::LineStringGraph::getNewEntity ( const geos::geom::Geometry *  Geom,
unsigned int  OfldId 
) [protected, virtual]

Creates a new LineStringEntity.

Parameters:
GeomThe geos::geom::Geometry of the new LineStringEntity to create.
OfldIdThe identifier of the new LineStringEntity.
Returns:
A new LandREntity.

Implements openfluid::landr::LandRGraph.

Fetch the associated raster value corresponding to the LineStringEntity EndNode coordinate.

Parameters:
EntityThe LineStringEntity to get the EndNode coordinate from.
Returns:
The raster value corresponding to the LineStringEntity EndNode coordinate.

Fetch the associated raster value corresponding to the LineStringEntity StartNode coordinate.

Parameters:
EntityThe LineStringEntity to get the StartNode coordinate from.
Returns:
The raster value corresponding to the LineStringEntity StartNode coordinate.

Returns a vector of LineStringEntity that have no up neighbour, according to the LineStringEntity orientations.

Returns the type of graph.

Implements openfluid::landr::LandRGraph.

Returns true if this LineStringGraph is an arborescence, false otherwise.

An arborescence is a graph with no loop; edges can be well directed or not.

Merges a LineStringEntity into an other one.

The LineStringEntity to merge is deleted.

Parameters:
EntityAn existent LineStringEntity.
EntityToMergeThe LineStringEntity which will be merged into Entity and will be deleted.
virtual void openfluid::landr::LineStringGraph::removeEntity ( int  OfldId) [virtual]

Removes from this LineStringGraph the LineStringEntity with OFLD_ID and its associated nodes.

Parameters:
OfldIdThe identifier.

Implements openfluid::landr::LandRGraph.

Reverse a LineStringEntity orientation.

Parameters:
EntityThe LineStringEntity to reverse.
virtual void openfluid::landr::LineStringGraph::setAttributeFromMeanRasterValues ( const std::string &  AttributeName) [virtual]

Creates a new attribute for this LineStringGraph entities, and set for each LineStringEntity this attribute value as the mean of the StartNode altitude and the EndNode altitude.

Parameters:
AttributeNameThe name of the attribute to create.

Implements openfluid::landr::LandRGraph.

Creates a new attribute for these LineStringGraph entities, and set for each LineStringEntity this attribute value as the associated raster values corresponding to the EndNode LineStringEntity coordinates.

Parameters:
AttributeNameThe name of the attribute to create for the EndNode

Creates a new attribute for these LineStringGraph entities, and set for each LineStringEntity this attribute value as the associated raster values corresponding to the StartNode LineStringEntity coordinates.

Parameters:
AttributeNameThe name of the attribute to create for the StartNode
virtual void openfluid::landr::LineStringGraph::setAttributeFromVectorLocation ( const std::string &  AttributeName,
openfluid::core::GeoVectorValue Vector,
const std::string &  Column,
double  Thresh = 0.0001 
) [virtual]

Creates a new attribute for this LineStringGraph entities, and set for each LineStringEntity this attribute value as the vector value corresponding to the Vector Entity Geometry.

Parameters:
AttributeNameThe name of the attribute to create.
VectorThe Name of the core::GeoVectorValue.
ColumnThe column of the core::GeoVectorValue to upload.
ThreshThe threshold of minimum distance between the core::GeoVectorValue geometry and the LineStringGraph geometry.

Implements openfluid::landr::LandRGraph.

virtual void openfluid::landr::LineStringGraph::setAttributeFromVectorLocation ( const std::string &  AttributeName,
openfluid::landr::VectorDataset Vector,
const std::string &  Column,
double  Thresh = 0.0001 
) [virtual]

Creates a new attribute for this LineStringGraph entities, and set for each LineStringEntity. this attribute value as the vector value corresponding to the Vector Entity Geometry.

Parameters:
AttributeNameThe name of the attribute to create.
VectorThe Name of the VectorDataset.
ColumnThe column of the VectorDataset to upload.
ThreshThe threshold of minimum distance between the VectorDataset geometry and the LineStringGraph geometry.

Implements openfluid::landr::LandRGraph.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines