TerraLib 4.1
TeOVERLAY Namespace Reference

Contains structures and definitions needed to execute Set Operations for polygons and lines (union, intersection e difference). More...

Classes

struct  xyOrder
 Defines a functor for coordinate order during map insert and retrival: lexicograpgical order (xy) More...
struct  segOrder
 Defines a functor for ordering segments during point in poly tests. More...

Typedefs

typedef multimap< TeCoord2D,
pair< unsigned int, TeLine2D >
, xyOrder
TeLineIndex
 Type to index fragments end points: used during merge fase.

Functions

TL_DLL bool TeOverlay (const TePolygonSet &redPols, const TePolygonSet &bluePols, TePolygonSet &polsOut, const short &operation)
 Executes one of the possible Set Operations on polygons.
TL_DLL bool TeUnion (TePolygonSet &redPols, TePolygonSet &bluePols, TePolygonSet &polsOut)
 Calculates the union Set Operation for polygons.
TL_DLL bool TeIntersection (const TePolygonSet &redPols, const TePolygonSet &bluePols, TePolygonSet &polsOut)
 Calculates the intersection Set Operation for polygons.
TL_DLL bool TeDifference (TePolygonSet &redPols, TePolygonSet &bluePols, TePolygonSet &polsOut)
 Calculates the difference set operation for polygons (redPols minus bluePols).
TL_DLL TeMultiGeometry TeOverlay (const TeLineSet &redLines, const TePolygonSet &bluePols, const short &operation)
 Executes one of the possible Set Operations for lines and polygons.
TL_DLL TeMultiGeometry TeUnion (TeLineSet &redLines, TePolygonSet &bluePols)
 Calculates the union set operation for lines and polygons.
TL_DLL TeMultiGeometry TeIntersection (TeLineSet &redLines, TePolygonSet &bluePols)
 Calculates the intersection set operation for lines and polygons.
TL_DLL TeMultiGeometry TeDifference (TeLineSet &redLines, TePolygonSet &bluePols)
 Calculates the defference set operation for lines and polygons.
TL_DLL bool TeUnion (TePolygonSet &polsIn, TePolygonSet &polsOut, const bool &makeCopy=true, const bool fixOrientation=true)
 Calculates the union of all polygons passed in polsIn parameter, and returns a polygon set (polsOut).
TL_DLL bool TeIntersection (TePolygonSet &redPols, vector< TePolygonSet > &bluePols, vector< TePolygonSet > &vecPolsOut, vector< bool > &resultVec, const bool &makeCopy=true, const bool fixOrientation=true)
 Calculates the intersection set operation for polygons. This version of intersection will reuse some pre-processing of redPols, and will do intersection between redPols and each polygonset in bluePols vector. The result of each individual operation (redPols x a polygonset from the blue vector) will be store in the output vector in the same order of polygonsets in bluePols. If an intersection is empty, an empty polygonset will be stored to indicate this.
TL_DLL bool TeUnion (TePolygonSet &redPols, vector< TePolygonSet > &bluePols, vector< TePolygonSet > &vecPolsOut, vector< bool > &resultVec, const bool &makeCopy=true, const bool fixOrientation=true)
 Calculates the union set operation for polygons. This version of union will reuse some pre-processing of redPols, and will do union between redPols and each polygonset in bluePols. The result of each individual operation (redPols x a polygonset from the blue vector) will be store in the output vector in the same order of polygonsets in bluePols.
TL_DLL bool TeDifference (TePolygonSet &redPols, vector< TePolygonSet > &bluePols, vector< TePolygonSet > &vecPolsOut, vector< bool > &resultVec, const bool &makeCopy=true, const bool fixOrientation=true)
 Calculates the difference set operation for polygons. This version of difference will reuse some pre-processing of redPols, and will do difference between redPols and each polygonset in bluePols vector. The result of each individual operation (redPols x a polygonset from the blue vector) will be store in the output vector in the same order of polygonsets in bluePols. If an intersection is empty, an empty polygonset will be stored to indicate this.
TL_DLL bool TePairUnion (TePolygonSet &psetIn, TePolygonSet &psetOut)
 Calculates the union of all polygons passed in polsIn parameter, and returns a polygon set (polsOut). This type of union use a different strategy from the previous one: do union for each pair and then repeat until we have only two pairs.
TL_DLL bool TeValidPolygonHoles (TePolygon &polygon, TePolygonSet &psValid)
 Valid polygon holes: if they have a commom edge, they will be joined (THIS IS FOR INTERNAL USE ONLY).
TL_DLL bool TeValidPolygonHoles (TePolygonSet &polygons, TePolygonSet &psValid)
 Valid polygon holes: if they have a commom edge, they will be joined (THIS IS FOR INTERNAL USE ONLY).
TL_DLL void TeFixOrientation (TePolygonSet &polSet, const short &outerOrientationToReverse, const short &innerOrientationToReverse)
 Verifies orientation for each line of polygon set, and reverse the orientation if need.
TL_DLL void TeChooseBoundaryLocation (const short &operation, short &locationRedFragments, short &locationBlueFragments)
 For each operation (union, intersection and difference) defines location for retrieval of fragments.
TL_DLL void TeRemoveOpositeBoundaryFragments (TeLineIndex &fragmentsIndex)
 Erases from fragmentsIndex boundary fragments that are in oposite direction: each fragment must have a unique identifier in the pair first field (pair<unsigned int, TeLine2D>)
TL_DLL void TeRemoveSameBoundaryFragments (TeLineIndex &fragmentsIndex)
 Erases from fragmentsIndex boundary fragments that are equals to another boundary fragment.
TL_DLL void TeJoinFragments (TeLineIndex &fragmentsIndex, TeLineIndex &boundaryFragmentsIndex)
 Merge fragments ito first index (fragmentsIndex)
TL_DLL void TeFindAndMoveClosedRings (TeLineIndex &fragmentsIndex, vector< TeLinearRing > &rings)
 Moves closed rings from fragmentsIndex to rins vector.
TL_DLL bool TeMountTopology (TePolygonSet &polysOut, vector< TeLinearRing > &holes)
 Gets a polygonset with outer rings and a vector with holes and try to find to what polygon the hole belongs to.
TL_DLL bool TeMergeFragments (TeLineIndex &fragmentsIndex, vector< TeLinearRing > &rings, const bool &doExaustive=false)
 Make polygons from fragments.
TL_DLL bool TeClassifyRings (vector< TeLinearRing > &rings, TePolygonSet &polsOut, vector< TeLinearRing > &holes)
 For each linear ring, see it's orientation and classify in outer or inner ring.
TL_DLL void TeRtreeGetFragments (const TePolygonSet &bluePolygons, TeINTERSECTOR2::TeSegmentRTree &blueTree, TeLineSet &redFragments, const short &locationFragments, short &mask, TeLineIndex &redFragmentsIndex, vector< TeLinearRing > &rings)
 Find fragments in the red set that satisfies locationFragments using blue set as reference.
TL_DLL void TeRtreeGetFragments (const TePolygonSet &polygons, TeINTERSECTOR2::TeSegmentRTree &tree, TeLineSet &fragments, vector< pair< unsigned int, unsigned int > > &fragmentsIds, const short &locationFragments, short &mask, TeLineIndex &fragmentsIndex, vector< TeLinearRing > &rings)
 Find fragments in the same set that satisfies locationFragments.
TL_DLL void TeRtreeRemoveFragments (const TePolygonSet &polygons, TeINTERSECTOR2::TeSegmentRTree &tree, TeLineIndex &lineIndex, vector< pair< unsigned int, unsigned int > > &fragmentsIds, const short &locationFragments, short &mask, vector< TeLinearRing > &rings)
 Removes fragments that may overlap with others: used in special cases during union process.
TL_DLL bool TeSplitRing (TeLinearRing &ring, TeLineSet &ringsOut)
 Split rings if they have commom end points.
TL_DLL bool TeSplitRings (vector< TeLinearRing > &rings, vector< TeLinearRing > &ringsOut)
 Split rings if they have commom end points.
TL_DLL bool TeCloneLine (const TeLine2D &lineIn, TeLine2D &lineOut, const unsigned int &minPts)
 Clone line point removing duplicated coordinates.
TL_DLL bool TeClonePolygon (const TePolygon &polIn, TePolygon &polOut)
 Clone polygon lines and try to remove duplicated coordinates from lines.
TL_DLL bool TeClonePolygonSet (const TePolygonSet &polsIn, TePolygonSet &polsOut)
 Clone polygons lines and try to remove duplicated coordinates from lines.

Detailed Description

Contains structures and definitions needed to execute Set Operations for polygons and lines (union, intersection e difference).


Typedef Documentation

typedef multimap<TeCoord2D, pair<unsigned int, TeLine2D>, xyOrder> TeOVERLAY::TeLineIndex

Type to index fragments end points: used during merge fase.


Function Documentation

void TeOVERLAY::TeChooseBoundaryLocation ( const short &  operation,
short &  locationRedFragments,
short &  locationBlueFragments 
)

For each operation (union, intersection and difference) defines location for retrieval of fragments.

bool TeOVERLAY::TeClassifyRings ( vector< TeLinearRing > &  rings,
TePolygonSet polsOut,
vector< TeLinearRing > &  holes 
)

For each linear ring, see it's orientation and classify in outer or inner ring.

bool TeOVERLAY::TeCloneLine ( const TeLine2D lineIn,
TeLine2D lineOut,
const unsigned int &  minPts 
)

Clone line point removing duplicated coordinates.

bool TeOVERLAY::TeClonePolygon ( const TePolygon polIn,
TePolygon polOut 
)

Clone polygon lines and try to remove duplicated coordinates from lines.

bool TeOVERLAY::TeClonePolygonSet ( const TePolygonSet polsIn,
TePolygonSet polsOut 
)

Clone polygons lines and try to remove duplicated coordinates from lines.

void TeOVERLAY::TeFindAndMoveClosedRings ( TeLineIndex &  fragmentsIndex,
vector< TeLinearRing > &  rings 
)

Moves closed rings from fragmentsIndex to rins vector.

void TeOVERLAY::TeFixOrientation ( TePolygonSet polSet,
const short &  outerOrientationToReverse,
const short &  innerOrientationToReverse 
)

Verifies orientation for each line of polygon set, and reverse the orientation if need.

void TeOVERLAY::TeJoinFragments ( TeLineIndex &  fragmentsIndex,
TeLineIndex &  boundaryFragmentsIndex 
)

Merge fragments ito first index (fragmentsIndex)

bool TeOVERLAY::TeMergeFragments ( TeLineIndex &  fragmentsIndex,
vector< TeLinearRing > &  rings,
const bool &  doExaustive = false 
)

Make polygons from fragments.

bool TeOVERLAY::TeMountTopology ( TePolygonSet polysOut,
vector< TeLinearRing > &  holes 
)

Gets a polygonset with outer rings and a vector with holes and try to find to what polygon the hole belongs to.

void TeOVERLAY::TeRemoveOpositeBoundaryFragments ( TeLineIndex &  fragmentsIndex)

Erases from fragmentsIndex boundary fragments that are in oposite direction: each fragment must have a unique identifier in the pair first field (pair<unsigned int, TeLine2D>)

void TeOVERLAY::TeRemoveSameBoundaryFragments ( TeLineIndex &  fragmentsIndex)

Erases from fragmentsIndex boundary fragments that are equals to another boundary fragment.

void TeOVERLAY::TeRtreeGetFragments ( const TePolygonSet bluePolygons,
TeINTERSECTOR2::TeSegmentRTree blueTree,
TeLineSet redFragments,
const short &  locationFragments,
short &  mask,
TeLineIndex &  redFragmentsIndex,
vector< TeLinearRing > &  rings 
)

Find fragments in the red set that satisfies locationFragments using blue set as reference.

void TeOVERLAY::TeRtreeGetFragments ( const TePolygonSet polygons,
TeINTERSECTOR2::TeSegmentRTree tree,
TeLineSet fragments,
vector< pair< unsigned int, unsigned int > > &  fragmentsIds,
const short &  locationFragments,
short &  mask,
TeLineIndex &  fragmentsIndex,
vector< TeLinearRing > &  rings 
)

Find fragments in the same set that satisfies locationFragments.

void TeOVERLAY::TeRtreeRemoveFragments ( const TePolygonSet polygons,
TeINTERSECTOR2::TeSegmentRTree tree,
TeLineIndex &  lineIndex,
vector< pair< unsigned int, unsigned int > > &  fragmentsIds,
const short &  locationFragments,
short &  mask,
vector< TeLinearRing > &  rings 
)

Removes fragments that may overlap with others: used in special cases during union process.

bool TeOVERLAY::TeSplitRing ( TeLinearRing ring,
TeLineSet ringsOut 
)

Split rings if they have commom end points.

adiciono a coordenada corrente ao fragmento corrente

bool TeOVERLAY::TeSplitRings ( vector< TeLinearRing > &  rings,
vector< TeLinearRing > &  ringsOut 
)

Split rings if they have commom end points.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines