GEOS 3.11.1
|
Reduces the precision of a geom::Geometry
according to the supplied geom::PrecisionModel
, ensuring that the result is valid (unless specified otherwise).
More...
#include <GeometryPrecisionReducer.h>
Public Member Functions | |
GeometryPrecisionReducer (const geom::PrecisionModel &pm) | |
GeometryPrecisionReducer (const geom::GeometryFactory &changeFactory) | |
Create a reducer that will change the precision model of the new reduced Geometry. More... | |
void | setRemoveCollapsedComponents (bool remove) |
void | setChangePrecisionModel (bool change) |
Sets whether the geom::PrecisionModel of the new reduced Geometry will be changed to be the geom::PrecisionModel supplied to specify the precision reduction. The default is to not change the precision model. More... | |
void | setUseAreaReducer (bool useAR) |
void | setPointwise (bool pointwise) |
Sets whether the precision reduction will be done in pointwise fashion only. More... | |
std::unique_ptr< geom::Geometry > | reduce (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) |
static std::unique_ptr< geom::Geometry > | reduceKeepCollapsed (const geom::Geometry &g, const geom::PrecisionModel &precModel) |
Reduces the precision of a geom::Geometry
according to the supplied geom::PrecisionModel
, ensuring that the result is valid (unless specified otherwise).
By default the reduced result is topologically valid To ensure this a polygonal geometry is reduced in a topologically valid fashion (technically, by using snap-rounding). It can be forced to be reduced pointwise by using setPointwise(boolean). Note that in this case the result geometry may be invalid. Linear and point geometry is always reduced pointwise (i.e. without further change to its topology or stucture), since this does not change validity.
By default the geometry precision model is not changed. This can be overridden by usingsetChangePrecisionModel(boolean).
Normally collapsed components (e.g. lines collapsing to a point) are not included in the result. This behavior can be changed by using setRemoveCollapsedComponents(boolean).
|
inline |
Create a reducer that will change the precision model of the new reduced Geometry.
changeFactory | 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 |
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 |
|
inline |
Sets whether the geom::PrecisionModel
of the new reduced Geometry will be changed to be the geom::PrecisionModel
supplied to specify the precision reduction. The default is to not change the precision model.
change | if true the precision model of the created Geometry will be the the precisionModel supplied in the constructor. |
|
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 |
|
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 |