| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

Functions
Set Operations

## Functions

TL_DLL bool | TeOVERLAY::TeOverlay (const TePolygonSet &redPols, const TePolygonSet &bluePols, TePolygonSet &polsOut, const short &operation)
| Executes one of the possible Set Operations on polygons.
TL_DLL bool | TeOVERLAY::TeUnion (TePolygonSet &redPols, TePolygonSet &bluePols, TePolygonSet &polsOut)
| Calculates the union Set Operation for polygons.
TL_DLL bool | TeOVERLAY::TeIntersection (const TePolygonSet &redPols, const TePolygonSet &bluePols, TePolygonSet &polsOut)
| Calculates the intersection Set Operation for polygons.
TL_DLL bool | TeOVERLAY::TeDifference (TePolygonSet &redPols, TePolygonSet &bluePols, TePolygonSet &polsOut)
| Calculates the difference set operation for polygons (redPols minus bluePols).
TL_DLL TeMultiGeometry | TeOVERLAY::TeOverlay (const TeLineSet &redLines, const TePolygonSet &bluePols, const short &operation)
| Executes one of the possible Set Operations for lines and polygons.
TL_DLL TeMultiGeometry | TeOVERLAY::TeUnion (TeLineSet &redLines, TePolygonSet &bluePols)
| Calculates the union set operation for lines and polygons.
TL_DLL TeMultiGeometry | TeOVERLAY::TeIntersection (TeLineSet &redLines, TePolygonSet &bluePols)
| Calculates the intersection set operation for lines and polygons.
TL_DLL TeMultiGeometry | TeOVERLAY::TeDifference (TeLineSet &redLines, TePolygonSet &bluePols)
| Calculates the defference set operation for lines and polygons.
TL_DLL bool | TeOVERLAY::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 | TeOVERLAY::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 | TeOVERLAY::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 | TeOVERLAY::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 | TeOVERLAY::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 | TeOVERLAY::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 | TeOVERLAY::TeValidPolygonHoles (TePolygonSet &polygons, TePolygonSet &psValid)
| Valid polygon holes: if they have a commom edge, they will be joined (THIS IS FOR INTERNAL USE ONLY).

## Detailed Description

Set operations for polygons and lines: intersection, union or difference.

## Function Documentation

bool TeOVERLAY::TeDifference | ( | TePolygonSet & | redPols,
|  | TePolygonSet & | bluePols,
|  | TePolygonSet & | polsOut
| ) |  |

Calculates the difference set operation for polygons (redPols minus bluePols).

Parameters:

  redPols | The first list of disjoint polygons (and without self-intersections).
  bluePols | The second list of disjoint polygons (and without self-intersections).
  polsOut | The polygon list from the operation result.

Returns:
  True if the operation success and false if an error has ocurried.

TeMultiGeometry TeOVERLAY::TeDifference | ( | TeLineSet & | redLines,
|  | TePolygonSet & | bluePols
| ) |  |

Calculates the defference set operation for lines and polygons.

Parameters:

  redLines | A disjoint line list (and without self-intersections).
  bluePols | A list of disjoint polygons (and without self-intersections).

Returns:
  A geometry formed only by lines or empty.

bool TeOVERLAY::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.

Parameters:

  redPols | A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
  bluePols | A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
  vecPolsOut | A vector with the result of differnce between redPols and each polygonset in the blue polygonset vector.
  resultVec | A vector of bool that tells if individual intersection succeed or not.
  makeCopy | If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
  fixOrientation | If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).

Returns:
  True if the operation success and false if an error has ocurried.

Note:
  The output vector may contains polygonsets thar are empty, only to indicate that intersection was empty, so be carefull.

bool TeOVERLAY::TeIntersection | ( | const TePolygonSet & | redPols,
|  | const TePolygonSet & | bluePols,
|  | TePolygonSet & | polsOut
| ) |  |

Calculates the intersection Set Operation for polygons.

Parameters:

  redPols | The first list of disjoint polygons (and without self-intersections).
  bluePols | The second list of disjoint polygons (and without self-intersections).
  polsOut | The polygon list from the operation result.

Returns:
  True if the operation success and false if an error has ocurried.

bool TeOVERLAY::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.

Parameters:

  redPols | A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
  bluePols | A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
  vecPolsOut | A vector with the result of intersection between redPols and each polygonset in the blue polygonset vector.
  resultVec | A vector of bool that tells if individual intersection succeed or not.
  makeCopy | If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
  fixOrientation | If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).

Returns:
  True if the operation success and false if an error has ocurried.

Note:
  The output vector may contains polygonsets thar are empty, only to indicate that intersection was empty, so be carefull.

TeMultiGeometry TeOVERLAY::TeIntersection | ( | TeLineSet & | redLines,
|  | TePolygonSet & | bluePols
| ) |  |

Calculates the intersection set operation for lines and polygons.

Parameters:

  redLines | A disjoint line list (and without self-intersections).
  bluePols | A list of disjoint polygons (and without self-intersections).

Returns:
  A geometry formed only by lines or empty.

TeMultiGeometry TeOVERLAY::TeOverlay | ( | const TeLineSet & | redLines,
|  | const TePolygonSet & | bluePols,
|  | const short & | operation
| ) |  |

Executes one of the possible Set Operations for lines and polygons.

Parameters:

  redLines | A disjoint line list (and without self-intersections).
  bluePols | A list of disjoint polygons (and without self-intersections).
  operation | Type of operation: TeUNION, TeINTERSECTION or TeDIFFERENCE.

Returns:
  A geometry that can contains only lines on intersection and difference cases, and lines + polygons on union case.

Note:
  This function must not be called directly, instead of call it, choose a specific function below, because, this signature is deprecated and will change in near future.

bool TeOVERLAY::TeOverlay | ( | const TePolygonSet & | redPols,
|  | const TePolygonSet & | bluePols,
|  | TePolygonSet & | polsOut,
|  | const short & | operation
| ) |  |

Executes one of the possible Set Operations on polygons.

Parameters:

  redPols | The first list of disjoint polygons (and without self-intersections).
  bluePols | The second list of disjoint polygons (and without self-intersections).
  polsOut | The polygon list from the operation result.
  operation | Type of operation: TeUNION, TeINTERSECTION or TeDIFFERENCE.

Returns:
  True if the operation success and false if an error has ocurried.

Note:
  Each polygon list must have disjoint polygons, otherwise, the result is undefined. This function must not be called directly, instead of call it, choose a specific function below, because, this signature is deprecated and will change in near future.

bool TeOVERLAY::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.

Parameters:

  psetIn | A list of polygons, may have overlap (disjoint or not).
  psetOut | Where the union will be stored.

bool TeOVERLAY::TeUnion | ( | TePolygonSet & | redPols,
|  | TePolygonSet & | bluePols,
|  | TePolygonSet & | polsOut
| ) |  |

Calculates the union Set Operation for polygons.

Parameters:

  redPols | The first list of disjoint polygons (and without self-intersections).
  bluePols | The second list of disjoint polygons (and without self-intersections).
  polsOut | The polygon list from the operation result.

Returns:
  True if the operation success and false if an error has ocurried.

bool TeOVERLAY::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).

Parameters:

  polsIn | A list of polygons, may have overlap (disjoint or not).
  polsOut | Where the union will be stored.
  makeCopy | If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
  fixOrientation | If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).

TeMultiGeometry TeOVERLAY::TeUnion | ( | TeLineSet & | redLines,
|  | TePolygonSet & | bluePols
| ) |  |

Calculates the union set operation for lines and polygons.

Parameters:

  redLines | A disjoint line list (and without self-intersections).
  bluePols | A list of disjoint polygons (and without self-intersections).

Returns:
  A geometry formed by lines and polygons or only by polygons.

bool TeOVERLAY::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.

Parameters:

  redPols | A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
  bluePols | A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
  vecPolsOut | A vector with the result of union between redPols and each polygonset in the blue polygonset vector.
  resultVec | A vector of bool that tells if individual intersection succeed or not.
  makeCopy | If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
  fixOrientation | If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).

Returns:
  True if the operation success and false if an error has ocurried.

bool TeOVERLAY::TeValidPolygonHoles | ( | TePolygonSet & | polygons,
|  | TePolygonSet & | psValid
| ) |  |

Valid polygon holes: if they have a commom edge, they will be joined (THIS IS FOR INTERNAL USE ONLY).

Parameters:

  polygons | The polygons to check holes.
  psValid | The result polygon.

Returns:
  Returns true if the operation successed otherwise returns false.

bool TeOVERLAY::TeValidPolygonHoles | ( | TePolygon & | polygon,
|  | TePolygonSet & | psValid
| ) |  |

Valid polygon holes: if they have a commom edge, they will be joined (THIS IS FOR INTERNAL USE ONLY).

Parameters:

  polygon | The polygon to check holes.
  psValid | The result polygon.

Returns:
  Returns true if the operation successed otherwise returns false.

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines