public static TileGrid getTileGrid ( BoundingBox totalBox , long matrixWidth , long matrixHeight , BoundingBox boundingBox ) { long minColumn = getTileColumn ( totalBox , matrixWidth , boundingBox . getMinLongitude ( ) ) ; long maxColumn = getTileColumn ( totalBox , matrixWidth , boundingBox . getMaxLongitude ( ) ) ; if ( minColumn < matrixWidth && maxColumn >= 0 ) { if ( minColumn < 0 ) { minColumn = 0 ; } if ( maxColumn >= matrixWidth ) { maxColumn = matrixWidth - 1 ; } } long maxRow = getTileRow ( totalBox , matrixHeight , boundingBox . getMinLatitude ( ) ) ; long minRow = getTileRow ( totalBox , matrixHeight , boundingBox . getMaxLatitude ( ) ) ; if ( minRow < matrixHeight && maxRow >= 0 ) { if ( minRow < 0 ) { minRow = 0 ; } if ( maxRow >= matrixHeight ) { maxRow = matrixHeight - 1 ; } } TileGrid tileGrid = new TileGrid ( minColumn , minRow , maxColumn , maxRow ) ; return tileGrid ; }
Get the tile grid