Class GeometryPrecisionReducer

Hierarchy: Object , GeometryPrecisionReducer
public class GeometryPrecisionReducer
Reduces the precision of a Geometry according to the supplied PrecisionModel, ensuring that the result is topologically valid.

Other

  • version: 1.12
public GeometryPrecisionReducer(PrecisionModel pm)
public static Geometry reduce(Geometry g, PrecisionModel precModel)
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 - g the geometry to reduce
precModel - precModel the precision model to use
Returns:
the reduced geometry
public static Geometry reducePointwise(Geometry g, PrecisionModel precModel)
Convenience method for doing pointwise 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 - g the geometry to reduce
precModel - precModel the precision model to use
Returns:
the reduced geometry
public void setRemoveCollapsedComponents(boolean removeCollapsed)
Sets whether the reduction will result in collapsed components being removed completely, or simply being collapsed to an (invalid) Geometry of the same type. The default is to remove collapsed components.
Parameters:
removeCollapsed - removeCollapsed if true collapsed components will be removed
public void setChangePrecisionModel(boolean changePrecisionModel)
Sets whether the PrecisionModel of the new reduced Geometry will be changed to be the PrecisionModel supplied to specify the precision reduction.

The default is to not change the precision model

Parameters:
changePrecisionModel - changePrecisionModel if true the precision model of the created Geometry will be the the precisionModel supplied in the constructor.
public void setPointwise(boolean isPointwise)
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:
isPointwise - isPointwise if reduction should be done pointwise only
public Geometry reduce(Geometry geom)