GEOS  3.8.0dev
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. More...
 
void setRemoveCollapsedComponents (bool remove)
 
void setPointwise (bool pointwise)
 Sets whether the precision reduction will be done in pointwise fashion only. More...
 
std::unique_ptr< geom::Geometryreduce (const geom::Geometry &geom)
 

Static Public Member Functions

static std::unique_ptr
< geom::Geometry
reduce (const geom::Geometry &g, const geom::PrecisionModel &precModel)
 
static std::unique_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
gfthe 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::unique_ptr<geom::Geometry> geos::precision::GeometryPrecisionReducer::reduce ( const geom::Geometry g,
const geom::PrecisionModel precModel 
)
inlinestatic

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
gthe geometry to reduce
precModelthe precision model to use
Returns
the reduced geometry

References reduce().

Referenced by reduce(), and reducePointwise().

static std::unique_ptr<geom::Geometry> geos::precision::GeometryPrecisionReducer::reducePointwise ( const geom::Geometry g,
const geom::PrecisionModel precModel 
)
inlinestatic

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
gthe geometry to reduce
precModelthe 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
pointwiseif 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
removeif true collapsed components will be removed

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