Class IntersectGeometries

java.lang.Object
org.openjump.core.geomutils.algorithm.IntersectGeometries

public class IntersectGeometries extends Object
  • Constructor Details

    • IntersectGeometries

      public IntersectGeometries()
  • Method Details

    • intersectPolygons

      public static ArrayList<org.locationtech.jts.geom.Geometry> intersectPolygons(ArrayList<org.locationtech.jts.geom.Geometry> geomList, double accuracy, TaskMonitor monitor, PlugInContext context)
      the method intersects all polygons in the geometry list with each other. An intersection is only proceeded if it returns another polygon (i.e. the intersection area > 0). Unfortunately the method returns results where some polygons may contain spikes. For this reason it may be better to create an an intersection of Linestrings (derived from the Polygons) and then use the Polygonizer (see IntersectPolygonLayersPlugIn).
      Parameters:
      geomList - list of geometries to process
      accuracy - this parameter is currently not used and replaced by the use of a fixed precision model
      monitor - can be null
      context - can be null
      Returns:
      an ArrayList of processed geometries
    • checkIntersectionByGeomTypeB

      public static boolean checkIntersectionByGeomTypeB(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2)
      Evaluates if two geometries intersect. E.g. for two polygons it evaluates if the intersection is an area and not just a line.
      This method is used since area1.intersection(area2) does return also a positive result if the intersection is on the boundary (i.e. no intersection of the interior).
      Note1: the order of how the geometries are provided matters! It tested such that g1.SpatialCritearia(g2).
      NOTE 2: the function has not been checked for mixed geometry types
      Parameters:
      g1 - first geometry
      g2 - second geometry
      Returns:
      true if more a geometry is split in at least 2 parts TODO : enable check of mixed geometries.
    • checkPolygonIntersection

      public static boolean checkPolygonIntersection(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2)
      Evaluates if two polygon geometries intersect. E.g. for two polygons it evaluates if the intersection is an area and not just a line.
      This method is used since area1.intersection(area2) does return also a positive result if the intersection is on the boundary (i.e. no intersection of the interior).
      Note1: the order of how the geometries are provided matters! It tested such that g1.SpatialCritearia(g2).
      NOTE 2: the function has not been checked for mixed geometry types
      Parameters:
      g1 - first geometry
      g2 - second geometry
      Returns:
      true if area(intersection) > 0 TODO : enable check of mixed geometries.
    • nodeLines

      public static Collection nodeLines(Collection lines)
      Nodes a collection of linestrings. Noding is done via JTS union, which is reasonably effective but may exhibit robustness failures. \n note: the method is taken from PolygonizerPlugIn
      Parameters:
      lines - the linear geometries to node
      Returns:
      a collection of linear geometries, noded together