public static boolean contains ( Bbox bbox , Coordinate coordinate ) { if ( bbox . getX ( ) >= coordinate . getX ( ) ) { return false ; } if ( bbox . getY ( ) >= coordinate . getY ( ) ) { return false ; } if ( bbox . getMaxX ( ) <= coordinate . getX ( ) ) { return false ; } if ( bbox . getMaxY ( ) <= coordinate . getY ( ) ) { return false ; } return true ; }
Is the given coordinate contained within the bounding box or not? If the coordinate is on the bounding box border it is considered outside .