public static BoundingBox getBoundingBox ( BoundingBox totalBox , long tileMatrixWidth , long tileMatrixHeight , TileGrid tileGrid ) { // Get the tile width double matrixMinX = totalBox . getMinLongitude ( ) ; double matrixMaxX = totalBox . getMaxLongitude ( ) ; double matrixWidth = matrixMaxX - matrixMinX ; double tileWidth = matrixWidth / tileMatrixWidth ; // Find the longitude range double minLon = matrixMinX + ( tileWidth * tileGrid . getMinX ( ) ) ; double maxLon = matrixMinX + ( tileWidth * ( tileGrid . getMaxX ( ) + 1 ) ) ; // Get the tile height double matrixMinY = totalBox . getMinLatitude ( ) ; double matrixMaxY = totalBox . getMaxLatitude ( ) ; double matrixHeight = matrixMaxY - matrixMinY ; double tileHeight = matrixHeight / tileMatrixHeight ; // Find the latitude range double maxLat = matrixMaxY - ( tileHeight * tileGrid . getMinY ( ) ) ; double minLat = matrixMaxY - ( tileHeight * ( tileGrid . getMaxY ( ) + 1 ) ) ; BoundingBox boundingBox = new BoundingBox ( minLon , minLat , maxLon , maxLat ) ; return boundingBox ; }
Get the bounding box of the tile grid in the tile width and height bounds using the total bounding box with constant units