Class IntersectionUtilities
- java.lang.Object
-
- org.openstreetmap.atlas.checks.utility.IntersectionUtilities
-
public final class IntersectionUtilities extends java.lang.ObjectA set of utilities that are common among intersection checks.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublefindIntersectionPercentage(org.openstreetmap.atlas.geography.Polygon polygon, org.openstreetmap.atlas.geography.Polygon otherPolygon)Find the percentage of overlap for givenPolygons.static booleanhaveExplicitLocationsForIntersections(org.openstreetmap.atlas.geography.PolyLine lineCrossed, org.openstreetmap.atlas.geography.atlas.items.LineItem crossingItem)Verifies intersections of givenPolyLineandLineItemare explicitLocations for both itemsstatic booleanhaveExplicitLocationsForIntersections(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.
-
-
-
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 givenPolygons.- Parameters:
polygon-Polygonto check for intersectionotherPolygon- AnotherPolygonto 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 givenPolyLineandLineItemare explicitLocations for both items- Parameters:
lineCrossed-PolyLinebeing crossedcrossingItem-LineItemcrossing- Returns:
- whether given
PolyLineandLineItem's intersections are actualLocations 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-PolyLinebeing crossedcrossingItem-LineItemcrossingintersections- the intersections between lineCrossed and crossingItem- Returns:
- whether given
PolyLineandLineItem's intersections are actualLocations for both items
-
-