private static boolean polygonDisjointMultiPoint_ ( Polygon polygon_a , MultiPoint multipoint_b , double tolerance , boolean bIncludeBoundaryA , ProgressTracker progress_tracker ) { // Quick rasterize test to see whether the the geometries are disjoint, // or if one is contained in the other. int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , multipoint_b , tolerance , false ) ; if ( relation == Relation . disjoint ) return true ; if ( relation == Relation . contains ) return false ; Envelope2D env_a_inflated = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a_inflated ) ; env_a_inflated . inflate ( tolerance , tolerance ) ; Point2D ptB = new Point2D ( ) ; for ( int i = 0 ; i < multipoint_b . getPointCount ( ) ; i ++ ) { multipoint_b . getXY ( i , ptB ) ; if ( ! env_a_inflated . contains ( ptB ) ) continue ; PolygonUtils . PiPResult result = PolygonUtils . isPointInPolygon2D ( polygon_a , ptB , tolerance ) ; if ( result == PolygonUtils . PiPResult . PiPInside || ( bIncludeBoundaryA && result == PolygonUtils . PiPResult . PiPBoundary ) ) return false ; } return true ; }
Returns true if polygon_a is disjoint from multipoint_b .