public BoundingBox expandCoordinates ( double maxProjectionLongitude ) { BoundingBox expanded = new BoundingBox ( this ) ; double minLongitude = getMinLongitude ( ) ; double maxLongitude = getMaxLongitude ( ) ; if ( minLongitude > maxLongitude ) { int worldWraps = 1 + ( int ) ( ( minLongitude - maxLongitude ) / ( 2 * maxProjectionLongitude ) ) ; maxLongitude += ( worldWraps * 2 * maxProjectionLongitude ) ; expanded . setMaxLongitude ( maxLongitude ) ; } return expanded ; }
Expand the bounding box max longitude above the max possible projection value if needed to create a bounding box where the max longitude is numerically larger than the min longitude .