@Test public void testMBTilesBounds() throws IOException, SQLException { MBTilesFile mbTilesFile = new MBTilesFile( new File("./src/test/resources/org/geotools/mbtiles/madagascar.mbtiles")); RectangleLong bounds = mbTilesFile.getTileBounds(7, true); assertEquals(79, bounds.getMinX()); assertEquals(82, bounds.getMaxX()); assertEquals(54, bounds.getMinY()); assertEquals(59, bounds.getMaxY()); RectangleLong boundsFull = mbTilesFile.getTileBounds(7, false); assertEquals(0, boundsFull.getMinX()); assertEquals(127, boundsFull.getMaxX()); assertEquals(0, boundsFull.getMinY()); assertEquals(127, boundsFull.getMaxY()); }
protected RectangleLong getTileBounds(long zoomLevel, boolean exact) throws SQLException { if (exact) { long minRow = minRow(zoomLevel); long maxRow = maxRow(zoomLevel); long minCol = minColumn(zoomLevel); long maxCol = maxColumn(zoomLevel); return new RectangleLong(minCol, maxCol, minRow, maxRow); } else { long tiles = tilesForZoom(zoomLevel); return new RectangleLong(0, tiles - 1, 0, tiles - 1); } }
MBTilesFile implements AutoCloseable { protected RectangleLong getTileBounds(long zoomLevel, boolean exact) throws SQLException { if (exact) { long minRow = minRow(zoomLevel); long maxRow = maxRow(zoomLevel); long minCol = minColumn(zoomLevel); long maxCol = maxColumn(zoomLevel); return new RectangleLong(minCol, maxCol, minRow, maxRow); } else { long tiles = tilesForZoom(zoomLevel); return new RectangleLong(0, tiles - 1, 0, tiles - 1); } } }
MBTilesFile implements AutoCloseable { protected RectangleLong getTileBounds(long zoomLevel, boolean exact) throws SQLException { if (exact) { long minRow = minRow(zoomLevel); long maxRow = maxRow(zoomLevel); long minCol = minColumn(zoomLevel); long maxCol = maxColumn(zoomLevel); return new RectangleLong(minCol, maxCol, minRow, maxRow); } else { long tiles = tilesForZoom(zoomLevel); return new RectangleLong(0, tiles - 1, 0, tiles - 1); } } MBTilesFile();  MBTilesFile(boolean disableJournal);  MBTilesFile(File file);  MBTilesFile(File file, boolean disableJournal);  MBTilesFile(File file, String user, String passwd, boolean disableJournal);  MBTilesFile(DataSource dataSource); }
MBTilesFile implements AutoCloseable { protected RectangleLong getTileBounds(long zoomLevel, boolean exact) throws SQLException { if (exact) { long minRow = minRow(zoomLevel); long maxRow = maxRow(zoomLevel); long minCol = minColumn(zoomLevel); long maxCol = maxColumn(zoomLevel); return new RectangleLong(minCol, maxCol, minRow, maxRow); } else { long tiles = tilesForZoom(zoomLevel); return new RectangleLong(0, tiles - 1, 0, tiles - 1); } } MBTilesFile();  MBTilesFile(boolean disableJournal);  MBTilesFile(File file);  MBTilesFile(File file, boolean disableJournal);  MBTilesFile(File file, String user, String passwd, boolean disableJournal);  MBTilesFile(DataSource dataSource); void saveMetaData(MBTilesMetadata metaData); void saveMinMaxZoomMetadata(int min, int max); void saveTile(MBTilesTile entry); void saveGrid(MBTilesGrid entry); MBTilesMetadata loadMetaData(); MBTilesMetadata loadMetaData(MBTilesMetadata metaData); MBTilesTile loadTile(long zoomLevel, long column, long row); MBTilesTile loadTile(MBTilesTile entry); MBTilesGrid loadGrid(long zoomLevel, long column, long row); MBTilesGrid loadGrid(MBTilesGrid entry); @SuppressWarnings("PMD.CloseResource") TileIterator tiles(); @SuppressWarnings("PMD.CloseResource") TileIterator tiles(long zoomLevel); @SuppressWarnings("PMD.CloseResource") TileIterator tiles(
            long zoomLevel, long leftTile, long bottomTile, long rightTile, long topTile); int numberOfTiles(); int numberOfTiles(long zoomLevel); long closestZoom(long zoomLevel); long minZoom(); long maxZoom(); long minColumn(long zoomLevel); long maxColumn(long zoomLevel); long minRow(long zoomLevel); long maxRow(long zoomLevel); void close(); File getFile(); void init(); }
MBTilesFile implements AutoCloseable { protected RectangleLong getTileBounds(long zoomLevel, boolean exact) throws SQLException { if (exact) { long minRow = minRow(zoomLevel); long maxRow = maxRow(zoomLevel); long minCol = minColumn(zoomLevel); long maxCol = maxColumn(zoomLevel); return new RectangleLong(minCol, maxCol, minRow, maxRow); } else { long tiles = tilesForZoom(zoomLevel); return new RectangleLong(0, tiles - 1, 0, tiles - 1); } } MBTilesFile();  MBTilesFile(boolean disableJournal);  MBTilesFile(File file);  MBTilesFile(File file, boolean disableJournal);  MBTilesFile(File file, String user, String passwd, boolean disableJournal);  MBTilesFile(DataSource dataSource); void saveMetaData(MBTilesMetadata metaData); void saveMinMaxZoomMetadata(int min, int max); void saveTile(MBTilesTile entry); void saveGrid(MBTilesGrid entry); MBTilesMetadata loadMetaData(); MBTilesMetadata loadMetaData(MBTilesMetadata metaData); MBTilesTile loadTile(long zoomLevel, long column, long row); MBTilesTile loadTile(MBTilesTile entry); MBTilesGrid loadGrid(long zoomLevel, long column, long row); MBTilesGrid loadGrid(MBTilesGrid entry); @SuppressWarnings("PMD.CloseResource") TileIterator tiles(); @SuppressWarnings("PMD.CloseResource") TileIterator tiles(long zoomLevel); @SuppressWarnings("PMD.CloseResource") TileIterator tiles(
            long zoomLevel, long leftTile, long bottomTile, long rightTile, long topTile); int numberOfTiles(); int numberOfTiles(long zoomLevel); long closestZoom(long zoomLevel); long minZoom(); long maxZoom(); long minColumn(long zoomLevel); long maxColumn(long zoomLevel); long minRow(long zoomLevel); long maxRow(long zoomLevel); void close(); File getFile(); void init(); static final String PRAGMA_JOURNAL_MODE_OFF; static final CoordinateReferenceSystem SPHERICAL_MERCATOR; static final ReferencedEnvelope WORLD_ENVELOPE; }