GEOS 3.4.2

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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
geos::precision::GeometryPrecisionReducer Class Reference

Reduces the precision of a Geometry according to the supplied PrecisionModel, ensuring that the result is topologically valid. More...

`#include <GeometryPrecisionReducer.h>`

## Public Member Functions
| GeometryPrecisionReducer (const geom::PrecisionModel &pm)
| GeometryPrecisionReducer (const geom::GeometryFactory &gf)
| Create a reducer that will change the precision model of the new reduced Geometry.
void | setRemoveCollapsedComponents (bool remove)
void | setPointwise (bool pointwise)
| Sets whether the precision reduction will be done in pointwise fashion only.
std::auto_ptr< geom::Geometry > | reduce (const geom::Geometry &geom)

## Static Public Member Functions
static std::auto_ptr < geom::Geometry > | reduce (const geom::Geometry &g, const geom::PrecisionModel &precModel)
static std::auto_ptr < geom::Geometry > | reducePointwise (const geom::Geometry &g, const geom::PrecisionModel &precModel)

## Detailed Description

Reduces the precision of a Geometry according to the supplied PrecisionModel, ensuring that the result is topologically valid.

## Constructor & Destructor Documentation

geos::precision::GeometryPrecisionReducer::GeometryPrecisionReducer | ( | const geom::GeometryFactory & | gf | ) |

Create a reducer that will change the precision model of the new reduced Geometry.

Parameters

  gf | the factory for the created Geometry. Its PrecisionModel will be used for the reduction. NOTE: ownership left to caller must be kept alive for the whole lifetime of the returned Geometry.

## Member Function Documentation

static std::auto_ptr<geom::Geometry> geos::precision::GeometryPrecisionReducer::reduce | ( | const geom::Geometry & | g,
|  | const geom::PrecisionModel & | precModel
| ) |  |
| inline static

Convenience method for doing precision reduction on a single geometry, with collapses removed and keeping the geometry precision model the same, and preserving polygonal topology.

Parameters

  g | the geometry to reduce
  precModel | the precision model to use

Returns
  the reduced geometry

References reduce().

Referenced by reduce(), and reducePointwise().

static std::auto_ptr<geom::Geometry> geos::precision::GeometryPrecisionReducer::reducePointwise | ( | const geom::Geometry & | g,
|  | const geom::PrecisionModel & | precModel
| ) |  |
| inline static

Convenience method for doing precision reduction on a single geometry, with collapses removed and keeping the geometry precision model the same, but NOT preserving valid polygonal topology.

Parameters

  g | the geometry to reduce
  precModel | the precision model to use

Returns
  the reduced geometry

References reduce(), and setPointwise().

void geos::precision::GeometryPrecisionReducer::setPointwise | ( | bool | pointwise | ) |
| inline

Sets whether the precision reduction will be done in pointwise fashion only.

Pointwise precision reduction reduces the precision of the individual coordinates only, but does not attempt to recreate valid topology. This is only relevant for geometries containing polygonal components.

Parameters

  pointwise | if reduction should be done pointwise only

Referenced by reducePointwise().

void geos::precision::GeometryPrecisionReducer::setRemoveCollapsedComponents | ( | bool | remove | ) |
| inline

Sets whether the reduction will result in collapsed components being removed completely, or simply being collapsed to an (invalid) Geometry of the same type.

Parameters

  remove | if `true` collapsed components will be removed

The documentation for this class was generated from the following file:

- GeometryPrecisionReducer.h