Package org.h2gis.functions.spatial.clean

## Class MakeValidOp

- java.lang.Object
- - org.h2gis.functions.spatial.clean.MakeValidOp

    public class MakeValidOp
    extends Object

Operator to make a geometry valid. Making a geometry valid will remove duplicate points although duplicate points do not make a geometry invalid.

Author:
  Michaël Michaud

### Constructor Summary

Constructors
`MakeValidOp()`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.locationtech.jts.geom.Geometry` `makeValid​(org.locationtech.jts.geom.Geometry geometry)` Repair an invalid geometry.
`MakeValidOp` `setPreserveCoordDim​(boolean preserveCoordDim)`
`MakeValidOp` `setPreserveDuplicateCoord​(boolean preserveDuplicateCoord)`
`MakeValidOp` `setPreserveGeomDim​(boolean preserveGeomDim)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MakeValidOp

    public MakeValidOp()

### Method Detail

#### setPreserveGeomDim

    public MakeValidOp setPreserveGeomDim​(boolean preserveGeomDim)

#### setPreserveCoordDim

    public MakeValidOp setPreserveCoordDim​(boolean preserveCoordDim)

#### setPreserveDuplicateCoord

    public MakeValidOp setPreserveDuplicateCoord​(boolean preserveDuplicateCoord)

#### makeValid

    public org.locationtech.jts.geom.Geometry makeValid​(org.locationtech.jts.geom.Geometry geometry)

Repair an invalid geometry. If preserveGeomDim is true, makeValid will remove degenerated geometries from the result, i.e geometries which dimension is lower than the input geometry dimension (except for mixed GeometryCollection). A multi-geometry will always produce a multi-geometry (eventually empty or made of a single component). A simple geometry may produce a multi-geometry (ex. polygon with self-intersection will generally produce a multi-polygon). In this case, it is up to the client to explode multi-geometries if he needs to. If preserveGeomDim is off, it is up to the client to filter degenerate geometries. WARNING : for geometries of dimension 1 (linear), duplicate coordinates are preserved as much as possible. For geometries of dimension 2 (areal), duplicate coordinates are generally removed due to the use of overlay operations.

Parameters:
  `geometry` - input geometry
Returns:
  a valid Geometry