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

A LandRGraph composed of PolygonEntities. More...

#include <landr/PolygonGraph.hpp>

Inheritance diagram for openfluid::landr::PolygonGraph:
openfluid::landr::LandRGraph

List of all members.

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.
PolygonEntitygetEntity (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 PolygonGraphcreate (openfluid::core::GeoVectorValue &Val)
 Creates a new PolygonGraph initialized from a core::GeoVectorValue.
static PolygonGraphcreate (openfluid::landr::VectorDataset &Vect)
 Create a new PolygonGraph initialized from a VectorDataset.
static PolygonGraphcreate (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 LandREntitygetNewEntity (const geos::geom::Geometry *Geom, unsigned int OfldId)
 Creates a new PolygonEntity.
PolygonEdgecreateEdge (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.

Detailed Description

A LandRGraph composed of PolygonEntities.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

void openfluid::landr::PolygonGraph::addEdgeAttribute ( std::string  AttributeName,
LandREntity Entity 
) [protected]

Adds an attribute to the PolygonEdge of a PolygonEntity.

Parameters:
AttributeNameThe name of the attribute to add.
EntityThe 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.

Clean the PolygonEdge of a PolygonEntity.

Parameters:
EntityThe 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.

Parameters:
GraphThe LineStringGraph to compare to.
RelationThe Relationship to use for comparison.
BufferDistanceThe distance below which we consider that two elements are related.
ContactLengthMin 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.

Parameters:
GraphThe LineStringGraph to compare to.
RelationThe Relationship to use for comparison, the LandRTools::Relationship INTERSECTS is not allowed.
BufferDistanceThe distance below which we consider that two elements are related.
ContactLengthMin Length of the LineString in intersection with polygon Buffered Boundaries to be taking acccount (only for LandRTools::TOUCHES RelationShip)

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.

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.

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.

Parameters:
LineStringThe geos::geom::LineString representing the PolygonEdge to create.
Returns:
The newly created PolygonEdge, or 0 if fails.
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.

Parameters:
AttributeNameThe name of the PolygonEdge attribute.
ValueThe 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.

Parameters:
FilePathThe path where to create the out file.
FileNameA name for the out file to create, with a .shp extension.

Returns a vector of the name of the PolygonEdge attributes.

Returns:
A vector of the name of the PolygonEdge attributes.

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.

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

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)

Parameters:
CompactnessThe compactness threshold (perimeter/2 x sqrt (Pi x area))
Returns:
a multimap of PolygonEntity with key is the compactness of each PolygonEntity.

Gets a map of small PolygonEntity which area are under a threshold.

Parameters:
MinAreaThe area threshold (in map units).
Returns:
a multimap of PolygonEntity with key is the area of each PolygonEntity.

Gets a map of polygonized Raster polygons and its area intersecting Entity.

Parameters:
EntityThe PolygonEntity to compare with the associated Raster.
Returns:
A map of polygonized Raster Polygons, from associated polygonized raster, with for each one the intersection area.

Returns the type of graph.

Implements openfluid::landr::LandRGraph.

Returns true if this PolygonGraph has one or more islands.

Returns:
True if one or more islands are present, false otherwise.

Returns true if each PolygonEntity is complete.

Returns:
True if all PolygonEntity of this PolygonGraph are complete, false otherwise.

Merge a PolygonEntity into an other one.

The PolygonEntity to merge is deleted.

Parameters:
EntityAn existent PolygonEntity.
EntityToMergeThe 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.

Parameters:
AttributeNameThe name of the attribute to remove.
EntityThe LandREntity to remove the PolygonEdge attribute.
void openfluid::landr::PolygonGraph::removeEdgeAttribute ( std::string  AttributeName)

Removes the attribute of the PolygonEdge of this PolygonGraph.

Parameters:
AttributeNameThe 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.

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

Parameters:
EntityThe PolygonEntity to removes the segment to.
SegmentThe 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.

Parameters:
AttributeNameThe name of the attribute to create

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