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) |
Reduces the precision of a Geometry according to the supplied PrecisionModel, ensuring that the result is topologically valid.
geos::precision::GeometryPrecisionReducer::GeometryPrecisionReducer | ( | const geom::GeometryFactory & | gf | ) |
Create a reducer that will change the precision model of the new reduced Geometry.
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. |
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.
g | the geometry to reduce | |
precModel | the precision model to use |
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.
g | the geometry to reduce | |
precModel | the precision model to use |
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.
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.
remove | if true collapsed components will be removed |