boolean containsPoint ( @ Nonnull final Point p ) { if ( ! p . isDefined ( ) ) { return false ; } final int latMicroDeg = p . getLatMicroDeg ( ) ; if ( ( latMicroDegMin > latMicroDeg ) || ( latMicroDeg >= latMicroDegMax ) ) { return false ; } final int lonMicroDeg = p . getLonMicroDeg ( ) ; // Longitude boundaries can extend (slightly) outside the [-180,180) range. if ( lonMicroDeg < lonMicroDegMin ) { return ( lonMicroDegMin <= ( lonMicroDeg + Point . MICRO_DEG_360 ) ) && ( ( lonMicroDeg + Point . MICRO_DEG_360 ) < lonMicroDegMax ) ; } else if ( lonMicroDeg >= lonMicroDegMax ) { return ( lonMicroDegMin <= ( lonMicroDeg - Point . MICRO_DEG_360 ) ) && ( ( lonMicroDeg - Point . MICRO_DEG_360 ) < lonMicroDegMax ) ; } else { return true ; } }
Check if a point falls within a boundary . Note that the min values are inclusive for a boundary and the max values are exclusive . \