![]() |
A LandRGraph composed of LineStringEntities. More...
#include <landr/LineStringGraph.hpp>


Public Member Functions | |
| virtual | ~LineStringGraph () |
| LandRGraph::GraphType | getType () |
| Returns the type of graph. More... | |
| LineStringEntity * | entity (int OfldId) |
| Returns a LineStringEntity with OFLD_ID, or 0 if it doesn't exist. More... | |
| virtual void | removeEntity (int OfldId) |
| Removes from this LineStringGraph the LineStringEntity with OFLD_ID and its associated nodes. More... | |
| LineStringEntity * | lastLineStringEntity () |
| Returns the last LineStringEntity of this LineStringGraph, according to the LineStringEntity orientations, ie the one that has no down neighbour. More... | |
| std::vector< LineStringEntity * > | getEndLineStringEntities () |
| Returns a vector of LineStringEntity that have no down neighbour, according to the LineStringEntity orientations. More... | |
| std::vector< LineStringEntity * > | getStartLineStringEntities () |
| Returns a vector of LineStringEntity that have no up neighbour, according to the LineStringEntity orientations. More... | |
| double | getRasterValueForEntityStartNode (LineStringEntity &Entity) |
| Fetch the associated raster value corresponding to the LineStringEntity StartNode coordinate. More... | |
| double | getRasterValueForEntityEndNode (LineStringEntity &Entity) |
| Fetch the associated raster value corresponding to the LineStringEntity EndNode coordinate. More... | |
| 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. More... | |
| 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. More... | |
| void | reverseLineStringEntity (LineStringEntity &Entity) |
| Reverse a LineStringEntity orientation. More... | |
| bool | isLineStringGraphArborescence () |
| Returns true if this LineStringGraph is an arborescence, false otherwise. More... | |
| 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. More... | |
| void | mergeLineStringEntities (LineStringEntity &Entity, LineStringEntity &EntityToMerge) |
| Merges a LineStringEntity into an other one. More... | |
| std::multimap< double, LineStringEntity * > | getLineStringEntitiesByMinLength (double MinLength, bool rmDangle=true, bool HighDegree=true) |
| Gets a map of small LineStringEntity under length threshold. More... | |
| void | setOrientationByOfldId (int OfldId) |
| Set the orientation of the LineStringGraph with outlet identification by OFLD_ID identifier. Only for LineStringGraph of arborescence type. More... | |
| void | mergeLineStringEntitiesByMinLength (double MinLength, bool rmDangle=true) |
| Merges the entities of this LineStringGraph under length threshold. More... | |
Public Member Functions inherited from openfluid::landr::LandRGraph | |
| virtual | ~LandRGraph () |
| Entities_t | getEntities () |
| Returns a list of the LandREntity of this LandRGraph. More... | |
| Entities_t | getOfldIdOrderedEntities () |
| Returns a list of the LandREntity of this LandRGraph and sorted by identifier. More... | |
| std::map< int, LandREntity * > | getEntitiesByOfldId () |
| Returns a map of the LandREntity of this LandRGraph and their identifiers. More... | |
| unsigned int | getSize () const |
| Gets the number of LandREntity in the LandRGraph. More... | |
| void | removeUnusedNodes () |
| Removes from this LandRGraph the nodes of degree 0. More... | |
| void | addAttribute (const std::string &AttributeName) |
| Adds an attribute to this LandRGraph. More... | |
| void | removeAttribute (const std::string &AttributeName) |
| Removes an attribute to this LandRGraph. More... | |
| std::vector< std::string > | getAttributeNames () |
| Returns a vector of the names of the attributes of this LandRGraph. More... | |
| void | addAGeoRasterValue (openfluid::core::GeoRasterValue &Raster) |
| Associates a core::GeoRasterValue to this LandRGraph. More... | |
| void | addAGeoRasterValue (const openfluid::landr::RasterDataset &Raster) |
| Associates a RasterDataset to this LandRGraph. More... | |
| bool | hasAnAssociatedRaster () |
| Returns true if this LandRGraph has an associated raster, false otherwise. More... | |
| openfluid::landr::VectorDataset * | rasterPolygonized () |
| Transforms the associated raster value into an openfluid::landr::VectorDataset of polygons. More... | |
| std::vector< geos::geom::Polygon * > * | rasterPolygonizedPolys () |
| Transforms the associated raster value into a vector of geos::geom::Polygon. More... | |
| virtual double | getRasterValueForEntityCentroid (const LandREntity &Entity) |
| Fetchs the associated raster value corresponding to the LandREntity centroid coordinate. More... | |
| void | setAttributeFromRasterValueAtCentroid (const std::string &AttributeName) |
| Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the raster value corresponding to the LandREntity centroid coordinate. More... | |
| void | computeNeighbours () |
| Computes the LandREntity neighbours of each LandREntity of this LandRGraph, according to its type. More... | |
| void | exportToShp (const std::string &FilePath, const std::string &FileName) |
| Creates on disk a shapefile representing this LandRGraph. More... | |
| void | setAttributeFromVectorId (const std::string &AttributeName, openfluid::core::GeoVectorValue &Vector, const std::string &IdColumn, const std::string &ValueColumn) |
| Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the entity ID number. More... | |
| void | setAttributeFromVectorId (const std::string &AttributeName, openfluid::landr::VectorDataset &Vector, const std::string &IdColumn, const std::string &ValueColumn) |
| Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the entity OFLD_ID. More... | |
| virtual void | setAttributeFromVectorLocation (const std::string &AttributeName, openfluid::core::GeoVectorValue &Vector, const std::string &Column, double Thresh=0.0001) |
| Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the Vector Entity Geometry. More... | |
| virtual void | setAttributeFromVectorLocation (const std::string &AttributeName, openfluid::landr::VectorDataset &Vector, const std::string &Column, double Thresh=0.0001) |
| Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the Vector Entity Geometry. More... | |
| void | snapVertices (double snapTolerance) |
| Snap the vertices of this LandRGraph under a threshold. More... | |
Static Public Member Functions | |
| static LineStringGraph * | create (openfluid::core::GeoVectorValue &Val) |
| Creates a new LineStringGraph initialized from a core::GeoVectorValue. More... | |
| static LineStringGraph * | create (openfluid::landr::VectorDataset &Vect) |
| Creates a new LineStringGraph initialized from a VectorDataset. More... | |
| static LineStringGraph * | create (const LandRGraph::Entities_t &Entities) |
| Creates a new LineStringGraph initialized with a list of LandREntity. More... | |
Additional Inherited Members | |
Public Types inherited from openfluid::landr::LandRGraph | |
| enum | GraphType { POLYGON, LINESTRING } |
| typedef std::list< LandREntity * > | Entities_t |
Protected Attributes inherited from openfluid::landr::LandRGraph | |
| openfluid::landr::VectorDataset * | mp_Vector |
| The VectorDataset associated to this LandRGraph. More... | |
| const geos::geom::GeometryFactory * | mp_Factory |
| The geos::geom::GeometryFactory used to build this LandRGraph. More... | |
| std::map< int, LandREntity * > | m_EntitiesByOfldId |
| A map of the LandREntity of this LandRGraph and sorted by identifier. More... | |
| Entities_t | m_Entities |
| A list of the LandREntity of this LandRGraph. More... | |
| openfluid::landr::RasterDataset * | mp_Raster |
| The RasterDataset associated to this LandRGraph. More... | |
| openfluid::landr::VectorDataset * | mp_RasterPolygonized |
| The VectorDataset representation of the RasterDataset associated to this LandRGraph. More... | |
| std::vector< geos::geom::Polygon * > * | mp_RasterPolygonizedPolys |
| A vector of geos::geom::Polygon representation of the RasterDataset associated to this LandRGraph. More... | |
Static Protected Attributes inherited from openfluid::landr::LandRGraph | |
| static int | m_FileNum |
A LandRGraph composed of LineStringEntities.
|
protected |
|
protected |
Creates a new LineStringGraph initialized from a core::GeoVectorValue.
|
protected |
Creates a new LineStringGraph initialized from a VectorDataset.
|
virtual |
|
protectedvirtual |
Adds a LandREntity into this LineStringGraph.
Implements openfluid::landr::LandRGraph.
|
static |
Creates a new LineStringGraph initialized from a core::GeoVectorValue.
| Val | A core::GeoVectorValue which must be composed of one or many LineStrings, and each of them must contain a "OFLD_ID" attribute. |
|
static |
Creates a new LineStringGraph initialized from a VectorDataset.
| Vect | A VectorDataset which must be composed of one or many LineStrings, and each of them must contain a "OFLD_ID" attribute. |
|
static |
Creates a new LineStringGraph initialized with a list of LandREntity.
| Entities | A list of LandREntity which must be LineStringEntity. |
|
protectedvirtual |
Creates a new LineStringEntity.
| Geom | The geos::geom::Geometry of the new LineStringEntity to create. |
| OfldId | The identifier of the new LineStringEntity. |
Implements openfluid::landr::LandRGraph.
|
virtual |
Returns a LineStringEntity with OFLD_ID, or 0 if it doesn't exist.
Reimplemented from openfluid::landr::LandRGraph.
| std::vector<LineStringEntity*> openfluid::landr::LineStringGraph::getEndLineStringEntities | ( | ) |
Returns a vector of LineStringEntity that have no down neighbour, according to the LineStringEntity orientations.
| std::multimap<double,LineStringEntity*> openfluid::landr::LineStringGraph::getLineStringEntitiesByMinLength | ( | double | MinLength, |
| bool | rmDangle = true, |
||
| bool | HighDegree = true |
||
| ) |
Gets a map of small LineStringEntity under length threshold.
| MinLength | The length threshold (in map units). |
| rmDangle | : if true, get also dangles under the threshold. |
| HighDegree | : if true, do not get the if StartNode and EndNode of this LineStringEntitiy are Degree>=3. |
| double openfluid::landr::LineStringGraph::getRasterValueForEntityEndNode | ( | LineStringEntity & | Entity | ) |
Fetch the associated raster value corresponding to the LineStringEntity EndNode coordinate.
| Entity | The LineStringEntity to get the EndNode coordinate from. |
| double openfluid::landr::LineStringGraph::getRasterValueForEntityStartNode | ( | LineStringEntity & | Entity | ) |
Fetch the associated raster value corresponding to the LineStringEntity StartNode coordinate.
| Entity | The LineStringEntity to get the StartNode coordinate from. |
| std::vector<LineStringEntity*> openfluid::landr::LineStringGraph::getStartLineStringEntities | ( | ) |
Returns a vector of LineStringEntity that have no up neighbour, according to the LineStringEntity orientations.
|
virtual |
Returns the type of graph.
Implements openfluid::landr::LandRGraph.
| bool openfluid::landr::LineStringGraph::isLineStringGraphArborescence | ( | ) |
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.
| LineStringEntity* openfluid::landr::LineStringGraph::lastLineStringEntity | ( | ) |
Returns the last LineStringEntity of this LineStringGraph, according to the LineStringEntity orientations, ie the one that has no down neighbour.
| void openfluid::landr::LineStringGraph::mergeLineStringEntities | ( | LineStringEntity & | Entity, |
| LineStringEntity & | EntityToMerge | ||
| ) |
Merges a LineStringEntity into an other one.
The LineStringEntity to merge is deleted.
| Entity | An existent LineStringEntity. |
| EntityToMerge | The LineStringEntity which will be merged into Entity and will be deleted. |
| void openfluid::landr::LineStringGraph::mergeLineStringEntitiesByMinLength | ( | double | MinLength, |
| bool | rmDangle = true |
||
| ) |
Merges the entities of this LineStringGraph under length threshold.
| MinLength | The length threshold (in map units). |
| rmDangle | if true, remove also dangles under the threshold, default is true. |
|
virtual |
Removes from this LineStringGraph the LineStringEntity with OFLD_ID and its associated nodes.
| OfldId | The identifier. |
Implements openfluid::landr::LandRGraph.
| void openfluid::landr::LineStringGraph::reverseLineStringEntity | ( | LineStringEntity & | Entity | ) |
Reverse a LineStringEntity orientation.
| Entity | The LineStringEntity to reverse. |
|
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.
| AttributeName | The name of the attribute to create. |
Implements openfluid::landr::LandRGraph.
| void openfluid::landr::LineStringGraph::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.
| AttributeName | The name of the attribute to create for the EndNode |
| void openfluid::landr::LineStringGraph::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.
| AttributeName | The name of the attribute to create for the StartNode |
| void openfluid::landr::LineStringGraph::setOrientationByOfldId | ( | int | OfldId | ) |
Set the orientation of the LineStringGraph with outlet identification by OFLD_ID identifier. Only for LineStringGraph of arborescence type.
| OfldId | The identifier of the outlet. |
1.8.11