Class OpenJUMPMakeValidOp

java.lang.Object
com.vividsolutions.jump.geom.MakeValidOp
com.vividsolutions.jump.geom.OpenJUMPMakeValidOp

public class OpenJUMPMakeValidOp extends MakeValidOp
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 Details

    • OpenJUMPMakeValidOp

      public OpenJUMPMakeValidOp()
  • Method Details

    • 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.
      Specified by:
      makeValid in class MakeValidOp
      Parameters:
      geometry - input geometry
      Returns:
      a valid Geometry
    • main

      public static void main(String[] args) throws org.locationtech.jts.io.ParseException
      Throws:
      org.locationtech.jts.io.ParseException