| TerraLib 4.1

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

Functions
GeoProcessing functions

## Functions

TLFUNCTIONS_DLL bool | TeGeoOpAggregation (TeLayer *newLayer, TeTheme *theme, vector< string > &agregAttrVec, TeGroupingAttr &attrMM, TeSelectedObjects selOb, TeAsciiFile *logFile=0)
TLFUNCTIONS_DLL bool | TeGeoOpAdd (TeLayer *newLayer, TeTheme *theme, vector< TeTheme * > themeVec, TeSelectedObjects selObj=TeAll, TeAsciiFile *logFile=0)
TLFUNCTIONS_DLL bool | TeGeoOpOverlayIntersection (TeLayer *newLayer, TeTheme *theme, TeTheme *themeTrim, TeSelectedObjects selOb, TeSelectedObjects selObTrim, bool attrTrim, TeAsciiFile *logFile=0)
TLFUNCTIONS_DLL bool | TeGeoOpOverlayIntersection (TeLayer *newLayer, TeTheme *theme, TeTheme *themeTrim, TeSelectedObjects selObTrim, double backValue, TeAsciiFile *logFile=0)
TLFUNCTIONS_DLL bool | TeGeoOpOverlayDifference (TeLayer *newLayer, TeTheme *theme1, TeTheme *theme2, TeSelectedObjects selOb1, TeSelectedObjects selOb2, TeAsciiFile *logFile=0)
TLFUNCTIONS_DLL bool | TeGeoOpAssignDataLocationDistribute (TeTheme *themeMod, TeTheme *theme, const string &tableName, const int &spatialRelation, const vector< string > &attributes=vector< string >(), TeAsciiFile *logFile=0)
TLFUNCTIONS_DLL bool | TeGeoOpAssignByLocationCollect (TeTheme *restrTheme, TeTheme *srcTheme, const string &newTableName, TeGroupingAttr &measuresColl, const int &spatialRelation)
TLFUNCTIONS_DLL bool | TeGeoOpBuffer (TeLayer *newLayer, TeTheme *themeIn, const TeSelectedObjects &selOb, const TeBUFFERREGION::TeBufferType &bufferType, const double &bufferDistance, const unsigned int &bufferLevels, const unsigned int &numPoints, const bool &doUnion=false, const string &tableName="", const string &attrName="", TeAsciiFile *logFile=0, const bool &copyInputColumns=true)
TLFUNCTIONS_DLL bool | TeGeoOpNearestNeighbour (TeTheme *inputTheme, TeSelectedObjects iselObj, TeTheme *neighTheme, TeSelectedObjects nnselObj, const string &distColName="", const string &NNIDColName="")
| Calculates the distance to the nearest neighbour (NN) This function calculates the distance of objetcs in the input theme to the nearest object in a neighbour candidates theme. For complex geometries such as polygons, cells, lines, sets of geometries or multigeometries the NN is found based on thedistance between the centroids of the geometries (for both input and for neighbour candidates objects). If themes have different projections the distance will be computed using input theme projection.
TLFUNCTIONS_DLL bool | TeGeoOpOverlayUnion (TeLayer *newLayer, TeTheme *theme, TeTheme *themeOverlay, TeSelectedObjects selOb, TeSelectedObjects selObOverlay, TeAsciiFile *logFile=0)

## Detailed Description

A set of functions that execute some common operations when dealing with geographical data

## Function Documentation

TLFUNCTIONS_DLL bool TeGeoOpAdd | ( | TeLayer * | newLayer,
|  | TeTheme * | theme,
|  | vector< TeTheme * > | themeVec,
|  | TeSelectedObjects | selObj = `TeAll`,
|  | TeAsciiFile * | logFile = `0`
| ) |  |

Adds a set of themes generating a new layer

Parameters:

  newLayer | pointer to a valid layer already created in the database to store the result of the operation
  theme | pointer to the first theme being added: the new layer will have the same attributes as the this theme
  themeVec | a vector of themes that should be added to the first one
  selOb | a selection of the objects of the theme that should be added
  logFile | Optional: a pointer to a text file where error messages will be saved

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpAggregation | ( | TeLayer * | newLayer,
|  | TeTheme * | theme,
|  | vector< string > & | agregAttrVec,
|  | TeGroupingAttr & | attrMM,
|  | TeSelectedObjects | selOb,
|  | TeAsciiFile * | logFile = `0`
| ) |  |

Agreggates the objects of a theme generating a new layer

Parameters:

  newLayer | pointer to a valid layer already created in the database to store the result of the operation
  theme | pointer to the theme being aggregated
  agregAttrVect | a vector with the names of the attributes that should have the same value in order to aggregate two objects.
  attrMM | the definition of the attributes (with the measures over it) that should passed to the new layer
  selOb | a selection of the objects of the theme that should be aggregated
  logFile | Optional: a pointer to a text file where error messages will be saved

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpAssignByLocationCollect | ( | TeTheme * | restrTheme,
|  | TeTheme * | srcTheme,
|  | const string & | newTableName,
|  | TeGroupingAttr & | measuresColl,
|  | const int & | spatialRelation
| ) |  |

Assign Data By Location - Collect: collects the attributes of the objects of a theme and assign it to second theme based on a spatial relation

Parameters:

  restrTheme | pointer to theme that has the attributes that will be passed
  srcTheme | pointer to the theme that has the attributes that will be collected
  newTableName | name of the table that will store the attributes collected
  measuresColl | the definition of the attributes (with the measures over it) that should passed to first theme
  spatialRelation | a spatial relation (or a combination of) that will be used as the criteria to pass the attributes between the themes

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpAssignDataLocationDistribute | ( | TeTheme * | themeMod,
|  | TeTheme * | theme,
|  | const string & | tableName,
|  | const int & | spatialRelation,
|  | const vector< string > & | attributes = `vector< string >()`,
|  | TeAsciiFile * | logFile = `0`
| ) |  |

Assign Data By Location - Distribute: passes the attributes of the objects of a theme to the objects of a second theme based on a spatial relation

Parameters:

  themeMod | pointer to theme that has the attributes that will be passed
  theme | pointer to the theme that will receive the attributes
  tableName | name of the table that will store the attributes passed from the first theme
  spatialRelation | a spatial relation (or a combination of) that will be used as the criteria to pass the attributes between the themes
  attributes | a list of attributes from the first theme that should be distributes to the second theme
  logFile | Optional: a pointer to a text file where error messages will be saved

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpBuffer | ( | TeLayer * | newLayer,
|  | TeTheme * | themeIn,
|  | const TeSelectedObjects & | selOb,
|  | const TeBUFFERREGION::TeBufferType & | bufferType,
|  | const double & | bufferDistance,
|  | const unsigned int & | bufferLevels,
|  | const unsigned int & | numPoints,
|  | const bool & | doUnion = `false`,
|  | const string & | tableName = `""`,
|  | const string & | attrName = `""`,
|  | TeAsciiFile * | logFile = `0`,
|  | const bool & | copyInputColumns = `true`
| ) |  |

Generates a new layer with the buffers of the objects of a theme

Parameters:

  newLayer | pointer to a new layer that will receive the buffers generated
  themeIn | pointer to a source theme that will provide the objects to generate the buffers
  selOb | define which objects of the themeIn will be used
  bufferType | define the buffer type: inside/outside/inside+outside
  bufferDistance | the buffer distance in the same unit of the object geometries
  bufferLevels | the number of buffer rings
  numPoints | the number of points that should be used to describe the curved corners of the buffer zone
  doUnion | a flag to indicate if this function will dissolve barries among buffers
  tableName | name of the attribute table that will provide an attribute that defines the buffer distance for each object
  attrName | attribute name of the attribute table "tableName" that will provide the buffer distance for each object
  logFile | Optional: a pointer to a text file where error messages will be saved
  copyInputColumns | If TRUE, all the columns from the iput table will be also copied to the result layer

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpNearestNeighbour | ( | TeTheme * | inputTheme,
|  | TeSelectedObjects | iselObj,
|  | TeTheme * | neighTheme,
|  | TeSelectedObjects | nnselObj,
|  | const string & | distColName = `""`,
|  | const string & | NNIDColName = `""`
| ) |  |

Calculates the distance to the nearest neighbour (NN) This function calculates the distance of objetcs in the input theme to the nearest object in a neighbour candidates theme. For complex geometries such as polygons, cells, lines, sets of geometries or multigeometries the NN is found based on thedistance between the centroids of the geometries (for both input and for neighbour candidates objects). If themes have different projections the distance will be computed using input theme projection.

Parameters:

  inputTheme | pointer to the theme that contains the objects to which the nearest neighbour are being searched
  iselObj | a specific selection of the input theme
  neighTheme | pointer to the theme that contains the candidates to NN
  nnselObj | a specific selection of NN theme
  distColName | the name of the column that will contain the distance to the NN object. If empty, the name "DIST" will be used. If the column should be created in a specific table, use the convention "tableName.colName", otherwise the first static table will be sued. If the column exists its values will be updated, if it don't the column will be created.
  NNIDColName | the name of the column that will contain the identification of the NN object. If empty the column won't be generated.

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpOverlayDifference | ( | TeLayer * | newLayer,
|  | TeTheme * | theme1,
|  | TeTheme * | theme2,
|  | TeSelectedObjects | selOb1,
|  | TeSelectedObjects | selOb2,
|  | TeAsciiFile * | logFile = `0`
| ) |  |

Generates the geometrical difference between two themes (t1 - t2), generating a new layer

Parameters:

  newLayer | pointer to a valid layer already created in the database to store the result of the operation
  theme1 | pointer to the first theme
  theme2 | pointer to the second theme
  selOb | a selection of the objects of the first theme
  selOb | a selection of the objects of the second theme
  logFile | Optional: a pointer to a text file where error messages will be saved

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpOverlayIntersection | ( | TeLayer * | newLayer,
|  | TeTheme * | theme,
|  | TeTheme * | themeTrim,
|  | TeSelectedObjects | selOb,
|  | TeSelectedObjects | selObTrim,
|  | bool | attrTrim,
|  | TeAsciiFile * | logFile = `0`
| ) |  |

Clips a theme generating a new layer

Parameters:

  newLayer | pointer to a valid layer already created in the database to store the result of the operation
  theme | pointer to the theme being clipped
  themeTrim | pointer to the theme that has objects with polygon geometry that will be used as the mask for the clipping
  selOb | a selection of the objects of the theme that should be clipped
  selObTrim | a selection of the objects of the theme that should be used as mask
  attrTrim | flag to indicate that the attributes of the mask theme should be included in the new layer
  logFile | Optional: a pointer to a text file where error messages will be saved

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpOverlayIntersection | ( | TeLayer * | newLayer,
|  | TeTheme * | theme,
|  | TeTheme * | themeTrim,
|  | TeSelectedObjects | selObTrim,
|  | double | backValue,
|  | TeAsciiFile * | logFile = `0`
| ) |  |

Clips a theme generated from a layer with raster representation generating a new layer

Parameters:

  newLayer | pointer to a valid layer already created in the database to store the result of the operation
  theme | pointer to the theme being clipped
  themeTrim | pointer to the theme that has objects with polygon geometry that will be used as the mask for the clipping
  selObTrim | a selection of the objects of the theme that should be used as mask
  backValue | the value that should be used as the background
  logFile | Optional: a pointer to a text file where error messages will be saved

Returns:
  true if it succeed and false otherwise

TLFUNCTIONS_DLL bool TeGeoOpOverlayUnion | ( | TeLayer * | newLayer,
|  | TeTheme * | theme,
|  | TeTheme * | themeOverlay,
|  | TeSelectedObjects | selOb,
|  | TeSelectedObjects | selObOverlay,
|  | TeAsciiFile * | logFile = `0`
| ) |  |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines