
A LandRGraph composed of PolygonEntities. More...
#include <landr/PolygonGraph.hpp>
Public Types | |
| typedef std::map < geos::geom::Polygon *, double > | RastValByRastPoly_t |
| A a map of polygonized Raster geos::geom::Polygon and its area intersecting PolygonEntity. | |
Public Member Functions | |
| virtual | ~PolygonGraph () |
| LandRGraph::GraphType | getType () |
| Returns the type of graph. | |
| PolygonEntity * | getEntity (int OfldId) |
| Returns a PolygonEntity with OfldId, or 0 if it doesn't exist. | |
| bool | isComplete () |
| Returns true if each PolygonEntity is complete. | |
| bool | hasIsland () |
| Returns true if this PolygonGraph has one or more islands. | |
| RastValByRastPoly_t | getRasterPolyOverlapping (PolygonEntity &Entity) |
| Gets a map of polygonized Raster polygons and its area intersecting Entity. | |
| virtual void | setAttributeFromMeanRasterValues (const std::string &AttributeName) |
| Creates a new attribute for this PolygonGraph entities, and set for each PolygonEntity this attribute value as the mean of the overlapping raster values, relative to overlapping areas. | |
| void | createVectorRepresentation (std::string FilePath, std::string FileName) |
| Creates on disk a shapefile representing the PolygonEdges of this PolygonGraph. | |
| void | computeLineStringNeighbours (LineStringGraph &Graph, openfluid::landr::LandRTools::Relationship Relation, double BufferDistance, double ContactLength=0) |
| Computes the neighbours between the PolygonEntity elements of this PolygonGraph and the LineStringEntity of a LineStringGraph. | |
| void | computeNeighboursWithBarriers (LineStringGraph &Graph, openfluid::landr::LandRTools::Relationship Relation, double BufferDistance, double ContactLength=0) |
| Computes the neighbours between the PolygonEntity elements of this PolygonGraph by using the LineStringEntity of an input LineStringGraph which are considered as barriers. | |
| void | createEdgeAttribute (std::string AttributeName, openfluid::core::Value &Value) |
| Creates attribute for the PolygonEdge of this PolygonGraph. | |
| void | removeEdgeAttribute (std::string AttributeName) |
| Removes the attribute of the PolygonEdge of this PolygonGraph. | |
| std::vector< std::string > | getEdgeAttributeNames () |
| Returns a vector of the name of the PolygonEdge attributes. | |
| virtual void | removeEntity (int OfldId) |
| Removes from this PolygonGraph the PolygonEntity with OfldId and its associated nodes. | |
| void | cleanEdges (PolygonEntity &Entity) |
| Clean the PolygonEdge of a PolygonEntity. | |
| std::multimap< double, PolygonEntity * > | getPolygonEntitiesByMinArea (double MinArea) |
| Gets a map of small PolygonEntity which area are under a threshold. | |
| std::multimap< double, PolygonEntity * > | getPolygonEntitiesByCompactness (double Compactness) |
| Gets a map of sliver PolygonEntity which compactness value are superior to a compactness threshold (Gravelius Index) | |
| void | mergePolygonEntities (PolygonEntity &Entity, PolygonEntity &EntityToMerge) |
| Merge a PolygonEntity into an other one. | |
Static Public Member Functions | |
| static PolygonGraph * | create (openfluid::core::GeoVectorValue &Val) |
| Creates a new PolygonGraph initialized from a core::GeoVectorValue. | |
| static PolygonGraph * | create (openfluid::landr::VectorDataset &Vect) |
| Create a new PolygonGraph initialized from a VectorDataset. | |
| static PolygonGraph * | create (const LandRGraph::Entities_t &Entities) |
| Create a new PolygonGraph initialized with a list of LandREntity. | |
Protected Member Functions | |
| PolygonGraph () | |
| PolygonGraph (openfluid::core::GeoVectorValue &Val) | |
| Creates a new PolygonGraph initialized from a core::GeoVectorValue. | |
| PolygonGraph (openfluid::landr::VectorDataset &Vect) | |
| Creates a new PolygonGraph initialized from a VectorDataset. | |
| virtual void | addEntity (LandREntity *Entity) |
| Adds a LandREntity into this PolygonGraph. | |
| virtual LandREntity * | getNewEntity (const geos::geom::Geometry *Geom, unsigned int OfldId) |
| Creates a new PolygonEntity. | |
| PolygonEdge * | createEdge (geos::geom::LineString &LineString) |
| Creates a new PolygonEdge, with its two DirectedEdges and add them to this graph. | |
| void | removeSegment (PolygonEntity *Entity, geos::geom::LineString *Segment) |
| Removes a segment of the exterior boundary of the input PolygonEntity. | |
| void | addEdgeAttribute (std::string AttributeName, LandREntity &Entity) |
| Adds an attribute to the PolygonEdge of a PolygonEntity. | |
| void | removeEdgeAttribute (std::string AttributeName, LandREntity &Entity) |
| Removes an attribute to the PolygonEdge of a PolygonEntity. | |
A LandRGraph composed of PolygonEntities.
| typedef std::map<geos::geom::Polygon*, double> openfluid::landr::PolygonGraph::RastValByRastPoly_t |
A a map of polygonized Raster geos::geom::Polygon and its area intersecting PolygonEntity.
| openfluid::landr::PolygonGraph::PolygonGraph | ( | ) | [protected] |
| openfluid::landr::PolygonGraph::PolygonGraph | ( | openfluid::core::GeoVectorValue & | Val | ) | [protected] |
Creates a new PolygonGraph initialized from a core::GeoVectorValue.
| openfluid::landr::PolygonGraph::PolygonGraph | ( | openfluid::landr::VectorDataset & | Vect | ) | [protected] |
Creates a new PolygonGraph initialized from a VectorDataset.
| virtual openfluid::landr::PolygonGraph::~PolygonGraph | ( | ) | [virtual] |
| void openfluid::landr::PolygonGraph::addEdgeAttribute | ( | std::string | AttributeName, |
| LandREntity & | Entity | ||
| ) | [protected] |
Adds an attribute to the PolygonEdge of a PolygonEntity.
| AttributeName | The name of the attribute to add. |
| Entity | The LandREntity to add the PolygonEdge attribute. |
| virtual void openfluid::landr::PolygonGraph::addEntity | ( | LandREntity * | Entity | ) | [protected, virtual] |
Adds a LandREntity into this PolygonGraph.
Implements openfluid::landr::LandRGraph.
| void openfluid::landr::PolygonGraph::cleanEdges | ( | PolygonEntity & | Entity | ) |
Clean the PolygonEdge of a PolygonEntity.
| Entity | The PolygonEntity to clean. |
| void openfluid::landr::PolygonGraph::computeLineStringNeighbours | ( | LineStringGraph & | Graph, |
| openfluid::landr::LandRTools::Relationship | Relation, | ||
| double | BufferDistance, | ||
| double | ContactLength = 0 |
||
| ) |
Computes the neighbours between the PolygonEntity elements of this PolygonGraph and the LineStringEntity of a LineStringGraph.
| Graph | The LineStringGraph to compare to. |
| Relation | The Relationship to use for comparison. |
| BufferDistance | The distance below which we consider that two elements are related. |
| ContactLength | Min Length of the LineString in intersection with polygon Buffered Boundaries to be taking acccount (only for LandRTools::TOUCHES RelationShip) |
| void openfluid::landr::PolygonGraph::computeNeighboursWithBarriers | ( | LineStringGraph & | Graph, |
| openfluid::landr::LandRTools::Relationship | Relation, | ||
| double | BufferDistance, | ||
| double | ContactLength = 0 |
||
| ) |
Computes the neighbours between the PolygonEntity elements of this PolygonGraph by using the LineStringEntity of an input LineStringGraph which are considered as barriers.
A barrier between two PolygonEntity will avoid to considered them as neighbours.
A LineStringEntity is considered as a barrier if it lies within the buffer of this PolygonEntity polygon boundary.
| Graph | The LineStringGraph to compare to. |
| Relation | The Relationship to use for comparison, the LandRTools::Relationship INTERSECTS is not allowed. |
| BufferDistance | The distance below which we consider that two elements are related. |
| ContactLength | Min Length of the LineString in intersection with polygon Buffered Boundaries to be taking acccount (only for LandRTools::TOUCHES RelationShip) |
| static PolygonGraph* openfluid::landr::PolygonGraph::create | ( | openfluid::core::GeoVectorValue & | Val | ) | [static] |
Creates a new PolygonGraph initialized from a core::GeoVectorValue.
Val must be composed of one or many Polygons, and each of them must contain a "OFLD_ID" attribute.
| static PolygonGraph* openfluid::landr::PolygonGraph::create | ( | openfluid::landr::VectorDataset & | Vect | ) | [static] |
Create a new PolygonGraph initialized from a VectorDataset.
Vect must be composed of one or many Polygons, and each of them must contain a "OFLD_ID" attribute.
| static PolygonGraph* openfluid::landr::PolygonGraph::create | ( | const LandRGraph::Entities_t & | Entities | ) | [static] |
Create a new PolygonGraph initialized with a list of LandREntity.
Entities must be PolygonEntity.
| PolygonEdge* openfluid::landr::PolygonGraph::createEdge | ( | geos::geom::LineString & | LineString | ) | [protected] |
Creates a new PolygonEdge, with its two DirectedEdges and add them to this graph.
| LineString | The geos::geom::LineString representing the PolygonEdge to create. |
| void openfluid::landr::PolygonGraph::createEdgeAttribute | ( | std::string | AttributeName, |
| openfluid::core::Value & | Value | ||
| ) |
Creates attribute for the PolygonEdge of this PolygonGraph.
Doesn't reset if the AttributeName already exists.
| AttributeName | The name of the PolygonEdge attribute. |
| Value | The core::Value to associate to this attribute. |
| void openfluid::landr::PolygonGraph::createVectorRepresentation | ( | std::string | FilePath, |
| std::string | FileName | ||
| ) |
Creates on disk a shapefile representing the PolygonEdges of this PolygonGraph.
| FilePath | The path where to create the out file. |
| FileName | A name for the out file to create, with a .shp extension. |
| std::vector<std::string> openfluid::landr::PolygonGraph::getEdgeAttributeNames | ( | ) |
Returns a vector of the name of the PolygonEdge attributes.
| PolygonEntity* openfluid::landr::PolygonGraph::getEntity | ( | int | OfldId | ) | [virtual] |
Returns a PolygonEntity with OfldId, or 0 if it doesn't exist.
Reimplemented from openfluid::landr::LandRGraph.
| virtual LandREntity* openfluid::landr::PolygonGraph::getNewEntity | ( | const geos::geom::Geometry * | Geom, |
| unsigned int | OfldId | ||
| ) | [protected, virtual] |
Creates a new PolygonEntity.
| Geom | The geos::geom::Geometry of the new PolygonEntity to create. |
| OfldId | The identifier of the new PolygonEntity. |
Implements openfluid::landr::LandRGraph.
| std::multimap<double, PolygonEntity*> openfluid::landr::PolygonGraph::getPolygonEntitiesByCompactness | ( | double | Compactness | ) |
Gets a map of sliver PolygonEntity which compactness value are superior to a compactness threshold (Gravelius Index)
| Compactness | The compactness threshold (perimeter/2 x sqrt (Pi x area)) |
| std::multimap<double, PolygonEntity*> openfluid::landr::PolygonGraph::getPolygonEntitiesByMinArea | ( | double | MinArea | ) |
Gets a map of small PolygonEntity which area are under a threshold.
| MinArea | The area threshold (in map units). |
| RastValByRastPoly_t openfluid::landr::PolygonGraph::getRasterPolyOverlapping | ( | PolygonEntity & | Entity | ) |
Gets a map of polygonized Raster polygons and its area intersecting Entity.
| Entity | The PolygonEntity to compare with the associated Raster. |
| LandRGraph::GraphType openfluid::landr::PolygonGraph::getType | ( | ) | [virtual] |
Returns the type of graph.
Implements openfluid::landr::LandRGraph.
Returns true if this PolygonGraph has one or more islands.
Returns true if each PolygonEntity is complete.
| void openfluid::landr::PolygonGraph::mergePolygonEntities | ( | PolygonEntity & | Entity, |
| PolygonEntity & | EntityToMerge | ||
| ) |
Merge a PolygonEntity into an other one.
The PolygonEntity to merge is deleted.
| Entity | An existent PolygonEntity. |
| EntityToMerge | The PolygonEntity which will be merged into Entity and will be deleted. |
| void openfluid::landr::PolygonGraph::removeEdgeAttribute | ( | std::string | AttributeName, |
| LandREntity & | Entity | ||
| ) | [protected] |
Removes an attribute to the PolygonEdge of a PolygonEntity.
| AttributeName | The name of the attribute to remove. |
| Entity | The LandREntity to remove the PolygonEdge attribute. |
| void openfluid::landr::PolygonGraph::removeEdgeAttribute | ( | std::string | AttributeName | ) |
Removes the attribute of the PolygonEdge of this PolygonGraph.
| AttributeName | The name of the PolygonEdge attribute to delete. |
Does nothing if AttributeName doesn't exist.
| virtual void openfluid::landr::PolygonGraph::removeEntity | ( | int | OfldId | ) | [virtual] |
Removes from this PolygonGraph the PolygonEntity with OfldId and its associated nodes.
| OfldId |
Implements openfluid::landr::LandRGraph.
| void openfluid::landr::PolygonGraph::removeSegment | ( | PolygonEntity * | Entity, |
| geos::geom::LineString * | Segment | ||
| ) | [protected] |
Removes a segment of the exterior boundary of the input PolygonEntity.
| Entity | The PolygonEntity to removes the segment to. |
| Segment | The geos::geom::LineString to remove. |
| virtual void openfluid::landr::PolygonGraph::setAttributeFromMeanRasterValues | ( | const std::string & | AttributeName | ) | [virtual] |
Creates a new attribute for this PolygonGraph entities, and set for each PolygonEntity this attribute value as the mean of the overlapping raster values, relative to overlapping areas.
| AttributeName | The name of the attribute to create |
Implements openfluid::landr::LandRGraph.
1.7.6.1