Class GeometryEditor


  • public class GeometryEditor
    extends Object
    Geometry objects are unmodifiable; this class allows you to "modify" a Geometry in a sense -- the modified Geometry is returned as a new Geometry. The new Geometry's #isValid should be checked.
    • Constructor Summary

      Constructors 
      Constructor Description
      GeometryEditor()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsReference​(Collection collection, Object o)  
      org.locationtech.jts.geom.Geometry deleteVertices​(org.locationtech.jts.geom.Geometry geometry, Collection vertices)
      Deletes the given vertices (matched using ==, not #equals).
      org.locationtech.jts.geom.Geometry edit​(org.locationtech.jts.geom.Geometry geometry, GeometryEditor.GeometryEditorOperation operation)  
      org.locationtech.jts.geom.Geometry insertVertex​(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Coordinate existing1, org.locationtech.jts.geom.Coordinate existing2, org.locationtech.jts.geom.Coordinate v)
      Inserts v on the line segment with endpoints equal to existing1 and existing2
      org.locationtech.jts.geom.Geometry insertVertex​(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Coordinate target, org.locationtech.jts.geom.Geometry ignoreSegmentsOutside)
      The vertex will be inserted at the point closest to the target.
      org.locationtech.jts.geom.Geometry remove​(org.locationtech.jts.geom.Geometry g, org.locationtech.jts.geom.Geometry itemToRemove)  
      org.locationtech.jts.geom.Geometry removeRepeatedPoints​(org.locationtech.jts.geom.Geometry geometry)
      The input and output Geometries may share some Coordinate arrays.
    • Constructor Detail

      • GeometryEditor

        public GeometryEditor()
    • Method Detail

      • removeRepeatedPoints

        public org.locationtech.jts.geom.Geometry removeRepeatedPoints​(org.locationtech.jts.geom.Geometry geometry)
        The input and output Geometries may share some Coordinate arrays.
      • remove

        public org.locationtech.jts.geom.Geometry remove​(org.locationtech.jts.geom.Geometry g,
                                                         org.locationtech.jts.geom.Geometry itemToRemove)
        Returns:
        null if parent == itemToRemove
      • insertVertex

        public org.locationtech.jts.geom.Geometry insertVertex​(org.locationtech.jts.geom.Geometry geometry,
                                                               org.locationtech.jts.geom.Coordinate target,
                                                               org.locationtech.jts.geom.Geometry ignoreSegmentsOutside)
        The vertex will be inserted at the point closest to the target.
      • insertVertex

        public org.locationtech.jts.geom.Geometry insertVertex​(org.locationtech.jts.geom.Geometry geometry,
                                                               org.locationtech.jts.geom.Coordinate existing1,
                                                               org.locationtech.jts.geom.Coordinate existing2,
                                                               org.locationtech.jts.geom.Coordinate v)
        Inserts v on the line segment with endpoints equal to existing1 and existing2
      • deleteVertices

        public org.locationtech.jts.geom.Geometry deleteVertices​(org.locationtech.jts.geom.Geometry geometry,
                                                                 Collection vertices)
        Deletes the given vertices (matched using ==, not #equals).
      • containsReference

        public boolean containsReference​(Collection collection,
                                         Object o)