| TerraLib 4.1

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

Functions
Metric operators
Geometry algorithms

## Functions

TL_DLL void | TeGetMiddlePoint (const TeCoord2D &first, const TeCoord2D &last, TeCoord2D &middle)
| Returns the middle point of a segment.
TL_DLL double | TeDistance (const TeCoord2D &c1, const TeCoord2D &c2)
| Calculates the Euclidian distance between two points.
TL_DLL double | TeLength (const TeLine2D &l)
| Returns the length of a Line 2D.
TL_DLL double | TePerpendicularDistance (const TeCoord2D &first, const TeCoord2D &last, const TeCoord2D &pin, TeCoord2D &pinter)
| Perpendicular distance from point to segment.
TL_DLL double | TeMinimumDistance (const TeCoord2D &first, const TeCoord2D &last, const TeCoord2D &pin, TeCoord2D &pout, double tol=0.0)
| Minimal distance from point to segment.
template<class T >
double | TeGeometryArea (const T &)
| Template class to compute the area of a geometry.
template<>
TL_DLL double | TeGeometryArea (const TePolygon &p)
| This is a explicit specialization that returns the area of a TePolygon.
template<>
TL_DLL double | TeGeometryArea (const TePolygonSet &ps)
| This is a explicit specialization that returns the area of a TePolygonSet.
template<>
TL_DLL double | TeGeometryArea (const TeBox &b)
| This is a explicit specialization that returns the area of a Box.
template<>
TL_DLL double | TeGeometryArea (const TeMultiGeometry &mGeom)
| This is a explicit specialization that returns the area of a Box.

## Detailed Description

Functions that do some usefull metric operations.

## Function Documentation

TL_DLL double TeDistance | ( | const TeCoord2D & | c1,
|  | const TeCoord2D & | c2
| ) |  |

Calculates the Euclidian distance between two points.

Parameters:

  c1 | First coordinate;
  c2 | Second coordinate;

template<>

TL_DLL double TeGeometryArea | ( | const TePolygonSet & | ps | ) |

This is a explicit specialization that returns the area of a TePolygonSet.

template<>

TL_DLL double TeGeometryArea | ( | const TeBox & | b | ) |

This is a explicit specialization that returns the area of a Box.

template<>

TL_DLL double TeGeometryArea | ( | const TeMultiGeometry & | mGeom | ) |

This is a explicit specialization that returns the area of a Box.

template<>

TL_DLL double TeGeometryArea | ( | const TePolygon & | p | ) |

This is a explicit specialization that returns the area of a TePolygon.

template<class T >

double TeGeometryArea | ( | const T & |  | ) |

Template class to compute the area of a geometry.

Parameters:

  geom | The geometry whose area we want to known.

Note:
  This algorithm is based on the book Spatial Databases with Application to GIS by Philippe Rigaux, Michel O. Scholl and Agnes Voisard.

TL_DLL void TeGetMiddlePoint | ( | const TeCoord2D & | first,
|  | const TeCoord2D & | last,
|  | TeCoord2D & | middle
| ) |  |

Returns the middle point of a segment.

Parameters:

  first | The first segment's coordinate.
  last | The second segment's coordinate.
  middle | The middle point.

TL_DLL double TeLength | ( | const TeLine2D & | l | ) |

Returns the length of a Line 2D.

Parameters:

  l | The line to calculate the length.

TL_DLL double TeMinimumDistance | ( | const TeCoord2D & | first,
|  | const TeCoord2D & | last,
|  | const TeCoord2D & | pin,
|  | TeCoord2D & | pout,
|  | double | tol = `0.0`
| ) |  |

Minimal distance from point to segment.

Parameters:

  first | The first segment's coordinate.
  last | The second segment's coordinate.
  pin | The point to get the minimal distance from the segment. This point is inside the segment
  pout | The nearest segment point of the pin point.
  tol | Numerical tolerance

TL_DLL double TePerpendicularDistance | ( | const TeCoord2D & | first,
|  | const TeCoord2D & | last,
|  | const TeCoord2D & | pin,
|  | TeCoord2D & | pinter
| ) |  |

Perpendicular distance from point to segment.

Parameters:

  first | The first segment's coordinate.
  last | The second segment's coordinate.
  pin | The point to get the distance from the segment.
  pinter | The point of intersection on the segment.

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines