![]() |
A LandREntity representing a geos::geom::Polygon. More...
#include <landr/PolygonEntity.hpp>
Public Types | |
typedef std::map < PolygonEntity *, std::vector < PolygonEdge * > > | NeighboursMap_t |
A map of the PolygonEntity neighbours and their shared PolygonEdge to this PolygonEntity. More... | |
typedef std::map < LineStringEntity *, PolygonEdge * > | LineStringNeighboursMap_t |
A map of the LineStringEntity neighbours and the PolygonEdge in contact with this PolygonEntity. More... | |
Public Member Functions | |
PolygonEntity (const geos::geom::Geometry *NewPolygon, unsigned int OfldId) | |
Create a new PolygonEntity. More... | |
virtual | ~PolygonEntity () |
PolygonEntity * | clone () |
Clone a new PolygonEntity from this PolygonEntity. More... | |
const geos::geom::Polygon * | polygon () const |
Returns the geos::geom::Polygon associated to this PolygonEntity. More... | |
void | addEdge (PolygonEdge &Edge) |
Adds a PolygonEdge to this PolygonEntity. More... | |
void | removeEdge (PolygonEdge *Edge) |
Removes a PolygonEdge to this PolygonEntity. More... | |
std::vector < geos::geom::LineString * > | computeLineIntersectionsWith (PolygonEntity &Other) |
Returns a vector of geos::geom::LineString representing the linear intersections between two PolygonEntity. More... | |
PolygonEdge * | findEdgeLineIntersectingWith (geos::geom::LineString &Segment) |
Returns the PolygonEdge containing Segment. More... | |
const NeighboursMap_t * | neighboursAndEdges () |
Returns a map of this PolygonEntity neighbours with for each a vector of the shared PolygonEdge. More... | |
std::vector< int > | getOrderedNeighbourOfldIds () |
Returns a vector of the OFLD_ID of this PolygonEntity neighbours, ascending ordered. More... | |
std::multimap< double, PolygonEntity * > | getOrderedNeighboursByLengthBoundary () |
Returns a multimap of the length of the shared boundary of each neighbour of this PolygonEntity and each PolygonEntity neighbour, ascending ordered by length shared boundary (shortest to longest boundary). More... | |
bool | isComplete () |
Check if this PolygonEntity is complete, that is if all PolygonEdge of this PolygonEntity, merged in a LineString, equals this PolygonEntity polygon exterior ring. More... | |
std::vector< PolygonEdge * > | getCommonEdgesWith (PolygonEntity &Other) |
Gets the PolygonEdge of this PolygonEntity that are shared with Other. More... | |
PolygonEntity * | neighbourWithCommonEdge (PolygonEdge *Edge) |
Gets the PolygonEntity which share the same Edge with the current PolygonEntity. More... | |
geos::geom::Geometry * | getBufferedBoundary (double BufferDistance) |
Gets the boundary of this PolygonEntity polygon, with a buffer of BufferDistance. More... | |
void | computeNeighbours () |
Computes the neighbours of this PolygonEntity. More... | |
void | computeLineStringNeighbours (LineStringGraph &Graph, LandRTools::Relationship Relation, double BufferDistance, double ContactLength=0) |
Computes the relations between this PolygonEntity and the LineStringEntity of an input LineStringGraph. More... | |
void | computeNeighboursWithBarriers (LineStringGraph &Graph, LandRTools::Relationship Relation, double BufferDistance, double ContactLength=0) |
Computes the relations between this PolygonEntity and its PolygonEntities Neighbours by using the LineStringEntity of an input LineStringGraph which are considered as barriers. More... | |
LineStringNeighboursMap_t * | lineStringNeighbours () |
Return the a map of the LineStringEntity neighbours of this PolygonEntity. More... | |
geos::geom::LineString * | mergeEdges (PolygonEdge *Edge, PolygonEdge *EdgeToMerge) |
Merge a PolygonEdge into an other one. More... | |
std::pair< LandREntity *, double > | computeNeighbourByLineTopology (VectorDataset LineTopology) |
Find the LandREntity neighbour of this PolygonEntity by using a line VectorDataset which indicates the neighbour relationship. More... | |
![]() | |
LandREntity (const geos::geom::Geometry *Geom, unsigned int OfldId) | |
virtual | ~LandREntity () |
const geos::geom::Geometry * | geometry () |
Returns the geos::geom::Geometry of this LandREntity. More... | |
unsigned int | getOfldId () const |
Returns the identifier of this LandREntity. More... | |
geos::geom::Point * | centroid () const |
Returns the centroid of this LandREntity. More... | |
double | getArea () const |
Returns the area of this LandREntity. More... | |
double | getLength () const |
Returns the length of this LandREntity. More... | |
std::set< LandREntity * > * | neighbours () |
Returns a set of LandREntity neighbours of this LandREntity. More... | |
bool | getAttributeValue (const std::string &AttributeName, core::Value &Value) const |
Gets the value of an attribute. More... | |
bool | setAttributeValue (const std::string &AttributeName, const core::Value *Value) |
Sets the value of an attribute. More... | |
double | getDistCentroCentro (LandREntity &Other) |
Gets the distance between this LandREntity centroid and Other LandREntity centroid. More... | |
LandREntity * | neighbour_MinDistCentroCentro () |
Gets the LandREntity neighbour that has the minimum centroid-to-centroid distance. More... | |
Public Attributes | |
NeighboursMap_t * | mp_NeighboursMap |
A Map of neighbours of PolygonEntity type and the related vector of PolygonEdge that are between this PolygonEntity and his neighbours. More... | |
LineStringNeighboursMap_t * | mp_LineStringNeighboursMap |
A Map of neighbours of LineStringEntity type and the related PolygonEdge that is between this PolygonEntity and his neighbours, if exist. More... | |
std::vector< PolygonEdge * > | m_PolyEdges |
A vector of the PolygonEdge of this PolygonEntity. More... | |
Additional Inherited Members | |
![]() | |
const geos::geom::Geometry * | mp_Geom |
The geos::geom::Geometry of this LandREntity. More... | |
unsigned int | m_OfldId |
The identifier of this LandREntity. More... | |
geos::geom::Point * | mp_Centroid |
The centroid of this LandREntity. More... | |
double | m_Area |
The area of this LandREntity. More... | |
double | m_Length |
The length of this LandREntity. More... | |
std::set< LandREntity * > * | mp_Neighbours |
A set of LandREntity neighbours of this LandREntity. More... | |
std::map< std::string, core::Value * > | m_Attributes |
A map of attributes of this LandREntity. More... | |
A LandREntity representing a geos::geom::Polygon.
A PolygonEntity has at least a PolygonEdge, all edges representing the Polygon exterior ring.
typedef std::map<LineStringEntity*, PolygonEdge*> openfluid::landr::PolygonEntity::LineStringNeighboursMap_t |
A map of the LineStringEntity neighbours and the PolygonEdge in contact with this PolygonEntity.
typedef std::map<PolygonEntity*, std::vector<PolygonEdge*> > openfluid::landr::PolygonEntity::NeighboursMap_t |
A map of the PolygonEntity neighbours and their shared PolygonEdge to this PolygonEntity.
openfluid::landr::PolygonEntity::PolygonEntity | ( | const geos::geom::Geometry * | NewPolygon, |
unsigned int | OfldId | ||
) |
Create a new PolygonEntity.
Takes ownership of NewPolygon.
NewPolygon | The geos::geom::Geometry of this new PolygonEntity. |
OfldId | The identifier of this new PolygonEntity. |
base::FrameworkException | if NewPolygon is not a geos::geom::Polygon or is not a valid geometry. |
|
virtual |
void openfluid::landr::PolygonEntity::addEdge | ( | PolygonEdge & | Edge | ) |
Adds a PolygonEdge to this PolygonEntity.
|
virtual |
Clone a new PolygonEntity from this PolygonEntity.
Implements openfluid::landr::LandREntity.
std::vector<geos::geom::LineString*> openfluid::landr::PolygonEntity::computeLineIntersectionsWith | ( | PolygonEntity & | Other | ) |
Returns a vector of geos::geom::LineString representing the linear intersections between two PolygonEntity.
Other | The PolygonEntity to compare to. |
void openfluid::landr::PolygonEntity::computeLineStringNeighbours | ( | LineStringGraph & | Graph, |
LandRTools::Relationship | Relation, | ||
double | BufferDistance, | ||
double | ContactLength = 0 |
||
) |
Computes the relations between this PolygonEntity and the LineStringEntity of an input LineStringGraph.
A LineStringEntity is considered as a neighbour if it lies within the buffer of this PolygonEntity polygon boundary.
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) |
std::pair< LandREntity*, double> openfluid::landr::PolygonEntity::computeNeighbourByLineTopology | ( | VectorDataset | LineTopology | ) |
Find the LandREntity neighbour of this PolygonEntity by using a line VectorDataset which indicates the neighbour relationship.
************** Following the directions of the * |-*--> * lines of the VectorDataset, * 1 * 3 * the neighbour of PolygonEntity 2 is * * * the PolygonEntity 1 and the neighbour * ^ ******** of PolygonEntity 1 is the PolygonEntity * | * 3. If a line of the VectorDataset crosses ******* a LineStringNeighbour of the PolygonEntity, * | * it becomes the neighbour :e.g, if LineStringNeighbour * - * exists between PolygonEntity 1 and 2, the neighbour * 2 * of PolygonEntity becomes this LineStringNeighbour. * * *******
LineTopology | A line VectorDataset |
|
virtual |
Computes the neighbours of this PolygonEntity.
A neighbour is another PolygonEntity that shares at least a PolygonEdge with this PolygonEntity.
Implements openfluid::landr::LandREntity.
void openfluid::landr::PolygonEntity::computeNeighboursWithBarriers | ( | LineStringGraph & | Graph, |
LandRTools::Relationship | Relation, | ||
double | BufferDistance, | ||
double | ContactLength = 0 |
||
) |
Computes the relations between this PolygonEntity and its PolygonEntities Neighbours 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) |
PolygonEdge* openfluid::landr::PolygonEntity::findEdgeLineIntersectingWith | ( | geos::geom::LineString & | Segment | ) |
Returns the PolygonEdge containing Segment.
Segment | The geos::geom::LineString to find. |
geos::geom::Geometry* openfluid::landr::PolygonEntity::getBufferedBoundary | ( | double | BufferDistance | ) |
Gets the boundary of this PolygonEntity polygon, with a buffer of BufferDistance.
BufferDistance | The buffer distance. |
std::vector<PolygonEdge*> openfluid::landr::PolygonEntity::getCommonEdgesWith | ( | PolygonEntity & | Other | ) |
Gets the PolygonEdge of this PolygonEntity that are shared with Other.
Other | A PolygonEntity. |
std::vector<int> openfluid::landr::PolygonEntity::getOrderedNeighbourOfldIds | ( | ) |
Returns a vector of the OFLD_ID of this PolygonEntity neighbours, ascending ordered.
std::multimap<double,PolygonEntity*> openfluid::landr::PolygonEntity::getOrderedNeighboursByLengthBoundary | ( | ) |
Returns a multimap of the length of the shared boundary of each neighbour of this PolygonEntity and each PolygonEntity neighbour, ascending ordered by length shared boundary (shortest to longest boundary).
bool openfluid::landr::PolygonEntity::isComplete | ( | ) |
Check if this PolygonEntity is complete, that is if all PolygonEdge of this PolygonEntity, merged in a LineString, equals this PolygonEntity polygon exterior ring.
LineStringNeighboursMap_t* openfluid::landr::PolygonEntity::lineStringNeighbours | ( | ) |
Return the a map of the LineStringEntity neighbours of this PolygonEntity.
geos::geom::LineString* openfluid::landr::PolygonEntity::mergeEdges | ( | PolygonEdge * | Edge, |
PolygonEdge * | EdgeToMerge | ||
) |
Merge a PolygonEdge into an other one.
Edge | An existent PolygonEdge. |
EdgeToMerge | Another PolygonEdge to merge. |
const NeighboursMap_t* openfluid::landr::PolygonEntity::neighboursAndEdges | ( | ) |
Returns a map of this PolygonEntity neighbours with for each a vector of the shared PolygonEdge.
PolygonEntity* openfluid::landr::PolygonEntity::neighbourWithCommonEdge | ( | PolygonEdge * | Edge | ) |
Gets the PolygonEntity which share the same Edge with the current PolygonEntity.
Edge | A PolygonEdge. |
const geos::geom::Polygon* openfluid::landr::PolygonEntity::polygon | ( | ) | const |
Returns the geos::geom::Polygon associated to this PolygonEntity.
void openfluid::landr::PolygonEntity::removeEdge | ( | PolygonEdge * | Edge | ) |
Removes a PolygonEdge to this PolygonEntity.
std::vector<PolygonEdge*> openfluid::landr::PolygonEntity::m_PolyEdges |
A vector of the PolygonEdge of this PolygonEntity.
LineStringNeighboursMap_t* openfluid::landr::PolygonEntity::mp_LineStringNeighboursMap |
A Map of neighbours of LineStringEntity type and the related PolygonEdge that is between this PolygonEntity and his neighbours, if exist.
NeighboursMap_t* openfluid::landr::PolygonEntity::mp_NeighboursMap |
A Map of neighbours of PolygonEntity type and the related vector of PolygonEdge that are between this PolygonEntity and his neighbours.