Class IntersectionUtilities


  • public final class IntersectionUtilities
    extends java.lang.Object
    A set of utilities that are common among intersection checks.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double findIntersectionPercentage​(org.openstreetmap.atlas.geography.Polygon polygon, org.openstreetmap.atlas.geography.Polygon otherPolygon)
      Find the percentage of overlap for given Polygons.
      static boolean haveExplicitLocationsForIntersections​(org.openstreetmap.atlas.geography.PolyLine lineCrossed, org.openstreetmap.atlas.geography.atlas.items.LineItem crossingItem)
      Verifies intersections of given PolyLine and LineItem are explicit Locations for both items
      static boolean haveExplicitLocationsForIntersections​(org.openstreetmap.atlas.geography.PolyLine lineCrossed, org.openstreetmap.atlas.geography.atlas.items.LineItem crossingItem, java.util.Set<org.openstreetmap.atlas.geography.Location> intersections)
      Overloaded: avoid recomputing the intersection locations if they're given.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • findIntersectionPercentage

        public static double findIntersectionPercentage​(org.openstreetmap.atlas.geography.Polygon polygon,
                                                        org.openstreetmap.atlas.geography.Polygon otherPolygon)
        Find the percentage of overlap for given Polygons.
        Parameters:
        polygon - Polygon to check for intersection
        otherPolygon - Another Polygon to check against for intersection
        Returns:
        percentage of overlap as a double; 0 if unable to clip
      • haveExplicitLocationsForIntersections

        public static boolean haveExplicitLocationsForIntersections​(org.openstreetmap.atlas.geography.PolyLine lineCrossed,
                                                                    org.openstreetmap.atlas.geography.atlas.items.LineItem crossingItem)
        Verifies intersections of given PolyLine and LineItem are explicit Locations for both items
        Parameters:
        lineCrossed - PolyLine being crossed
        crossingItem - LineItem crossing
        Returns:
        whether given PolyLine and LineItem's intersections are actual Locations for both items
      • haveExplicitLocationsForIntersections

        public static boolean haveExplicitLocationsForIntersections​(org.openstreetmap.atlas.geography.PolyLine lineCrossed,
                                                                    org.openstreetmap.atlas.geography.atlas.items.LineItem crossingItem,
                                                                    java.util.Set<org.openstreetmap.atlas.geography.Location> intersections)
        Overloaded: avoid recomputing the intersection locations if they're given.
        Parameters:
        lineCrossed - PolyLine being crossed
        crossingItem - LineItem crossing
        intersections - the intersections between lineCrossed and crossingItem
        Returns:
        whether given PolyLine and LineItem's intersections are actual Locations for both items