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

A LandREntity representing a geos::geom::Polygon. More...

#include <landr/PolygonEntity.hpp>

Inheritance diagram for openfluid::landr::PolygonEntity:
openfluid::landr::LandREntity

List of all members.

Public Types

typedef std::map
< PolygonEntity *, std::vector
< PolygonEdge * > > 
NeighboursMap_t
 A map of the PolygonEntity neighbours and their shared PolygonEdge to this PolygonEntity.
typedef std::map
< LineStringEntity
*, PolygonEdge * > 
LineStringNeighboursMap_t
 A map of the LineStringEntity neighbours and the PolygonEdge in contact with this PolygonEntity.

Public Member Functions

 PolygonEntity (const geos::geom::Geometry *NewPolygon, unsigned int OfldId)
 Create a new PolygonEntity.
virtual ~PolygonEntity ()
PolygonEntityclone ()
 Clone a new PolygonEntity from this PolygonEntity.
const geos::geom::Polygon * getPolygon () const
 Returns the geos::geom::Polygon associated to this PolygonEntity.
void addEdge (PolygonEdge &Edge)
 Adds a PolygonEdge to this PolygonEntity.
void removeEdge (PolygonEdge *Edge)
 Removes a PolygonEdge to this PolygonEntity.
std::vector
< geos::geom::LineString * > 
getLineIntersectionsWith (PolygonEntity &Other)
 Returns a vector of geos::geom::LineString representing the linear intersections between two PolygonEntity.
PolygonEdgefindEdgeLineIntersectingWith (geos::geom::LineString &Segment)
 Returns the PolygonEdge containing Segment.
const NeighboursMap_tgetNeighboursAndEdges ()
 Returns a map of this PolygonEntity neighbours with for each a vector of the shared PolygonEdge.
std::vector< int > getOrderedNeighbourOfldIds ()
 Returns a vector of the OFLD_ID of this PolygonEntity neighbours, ascending ordered.
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).
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.
std::vector< PolygonEdge * > getCommonEdgesWith (PolygonEntity &Other)
 Gets the PolygonEdge of this PolygonEntity that are shared with Other.
PolygonEntitygetNeighbourWithCommonEdge (PolygonEdge *Edge)
 Gets the PolygonEntity which share the same Edge with the current PolygonEntity.
geos::geom::Geometry * getBufferedBoundary (double BufferDistance)
 Gets the boundary of this PolygonEntity polygon, with a buffer of BufferDistance.
void computeNeighbours ()
 Computes the neighbours of this PolygonEntity.
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.
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.
LineStringNeighboursMap_tgetLineStringNeighbours ()
 Return the a map of the LineStringEntity neighbours of this PolygonEntity.
geos::geom::LineString * mergeEdges (PolygonEdge *Edge, PolygonEdge *EdgeToMerge)
 Merge a PolygonEdge into an other one.
LandREntitygetNeighbourByLineTopology (VectorDataset LineTopology)
 Find the LandREntity neighbour of this PolygonEntity by using a line VectorDataset which indicates the neighbour relationship.

Public Attributes

NeighboursMap_tmp_NeighboursMap
 A Map of neighbours of PolygonEntity type and the related vector of PolygonEdge that are between this PolygonEntity and his neighbours.
LineStringNeighboursMap_tmp_LineStringNeighboursMap
 A Map of neighbours of LineStringEntity type and the related PolygonEdge that is between this PolygonEntity and his neighbours, if exist.
std::vector< PolygonEdge * > m_PolyEdges
 A vector of the PolygonEdge of this PolygonEntity.

Detailed Description

A LandREntity representing a geos::geom::Polygon.

A PolygonEntity has at least a PolygonEdge, all edges representing the Polygon exterior ring.


Member Typedef Documentation

A map of the LineStringEntity neighbours and the PolygonEdge in contact with this PolygonEntity.

A map of the PolygonEntity neighbours and their shared PolygonEdge to this PolygonEntity.


Constructor & Destructor Documentation

openfluid::landr::PolygonEntity::PolygonEntity ( const geos::geom::Geometry *  NewPolygon,
unsigned int  OfldId 
)

Create a new PolygonEntity.

Takes ownership of NewPolygon.

Parameters:
NewPolygonThe geos::geom::Geometry of this new PolygonEntity.
OfldIdThe identifier of this new PolygonEntity.
Exceptions:
base::OFExceptionif NewPolygon is not a geos::geom::Polygon or is not a valid geometry.

Member Function Documentation

Adds a PolygonEdge to this PolygonEntity.

Clone a new PolygonEntity from this PolygonEntity.

Attention:
Doesn't deep-copy m_PolyEdges nor neighbours.

Implements openfluid::landr::LandREntity.

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.

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)

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.

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)

Returns the PolygonEdge containing Segment.

Parameters:
SegmentThe geos::geom::LineString to find.
Returns:
The PolygonEdge of this PolygonEntity containing the input geos::geom::LineString, or 0 if not found.
geos::geom::Geometry* openfluid::landr::PolygonEntity::getBufferedBoundary ( double  BufferDistance)

Gets the boundary of this PolygonEntity polygon, with a buffer of BufferDistance.

Parameters:
BufferDistanceThe buffer distance.
Returns:
A geos::geom::Geometry representing the buffered boundaries of this PolygonEntity.

Gets the PolygonEdge of this PolygonEntity that are shared with Other.

Parameters:
OtherA PolygonEntity.
Returns:
A vector of PolygonEdge.
std::vector<geos::geom::LineString*> openfluid::landr::PolygonEntity::getLineIntersectionsWith ( PolygonEntity Other)

Returns a vector of geos::geom::LineString representing the linear intersections between two PolygonEntity.

Parameters:
OtherThe PolygonEntity to compare to.
Returns:
A vector of new allocated geos::geom::LineString representing the linear intersections (eventually merged) between this PolygonEntity and Other.

Return the a map of the LineStringEntity neighbours of this PolygonEntity.

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.
         *     *           Do NOT work for PointEntity topology
         *******
      
Parameters:
LineTopologyA line VectorDataset
Returns:
A openfluid::landr:landREntity or an empty entity if not found.

Returns a map of this PolygonEntity neighbours with for each a vector of the shared PolygonEdge.

Gets the PolygonEntity which share the same Edge with the current PolygonEntity.

Parameters:
EdgeA PolygonEdge.
Returns:
A vector a PolygonEntity.

Returns a vector of the OFLD_ID of this PolygonEntity neighbours, ascending ordered.

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).

const geos::geom::Polygon* openfluid::landr::PolygonEntity::getPolygon ( ) const

Returns the geos::geom::Polygon associated to this PolygonEntity.

Check if this PolygonEntity is complete, that is if all PolygonEdge of this PolygonEntity, merged in a LineString, equals this PolygonEntity polygon exterior ring.

Returns:
True if complete, false otherwise.
geos::geom::LineString* openfluid::landr::PolygonEntity::mergeEdges ( PolygonEdge Edge,
PolygonEdge EdgeToMerge 
)

Merge a PolygonEdge into an other one.

Parameters:
EdgeAn existent PolygonEdge.
EdgeToMergeAnother PolygonEdge to merge.
Returns:
A geos::geom:LineString which have the geometry of the merged PolygonEdge.

Removes a PolygonEdge to this PolygonEntity.

Attention:
Also delete input parameter Edge.

Member Data Documentation

A vector of the PolygonEdge of this PolygonEntity.

A Map of neighbours of LineStringEntity type and the related PolygonEdge that is between this PolygonEntity and his neighbours, if exist.

A Map of neighbours of PolygonEntity type and the related vector of PolygonEdge that are between this PolygonEntity and his neighbours.


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