Java Code Examples for mil.nga.geopackage.tiles.user.TileDao#getMinZoom()

The following examples show how to use mil.nga.geopackage.tiles.user.TileDao#getMinZoom() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GeoPackageProvider.java    From osmdroid with Apache License 2.0 6 votes vote down vote up
public GeopackageRasterTileSource getTileSource(String database, String table) {
    Iterator<GeoPackage> iterator = geopackage.tileSources.iterator();
    while (iterator.hasNext()){
        GeoPackage next = iterator.next();
        if (next.getName().equalsIgnoreCase(database)) {
            //found the database
            if (next.getTileTables().contains(table)) {
                //find the tile table
                TileDao tileDao = next.getTileDao(table);
                mil.nga.geopackage.BoundingBox boundingBox = tileDao.getBoundingBox();
                ProjectionTransform transformation = tileDao.getProjection().getTransformation(tileDao.getProjection());
                boundingBox=transformation.transform(boundingBox);
                BoundingBox bounds =new BoundingBox(boundingBox.getMaxLatitude(),boundingBox.getMaxLongitude(),boundingBox.getMinLatitude(),boundingBox.getMinLongitude());
                return new GeopackageRasterTileSource(database,table, (int)tileDao.getMinZoom(),(int)tileDao.getMaxZoom(), bounds);
            }
        }
    }

    return null;
}
 
Example 2
Source File: GeoPackageTextOutput.java    From geopackage-java with MIT License 5 votes vote down vote up
/**
 * Build text from a tile table
 * 
 * @param table
 *            tile table
 * @return text
 */
public String tileTable(String table) {

	StringBuilder output = new StringBuilder();
	TileDao tileDao = geoPackage.getTileDao(table);
	output.append("Table Name: " + tileDao.getTableName());
	long minZoom = tileDao.getMinZoom();
	long maxZoom = tileDao.getMaxZoom();
	output.append("\nMin Zoom: " + minZoom);
	output.append("\nMax Zoom: " + maxZoom);
	output.append("\nTiles: " + tileDao.count());

	TileMatrixSet tileMatrixSet = tileDao.getTileMatrixSet();

	output.append("\n\nContents\n\n")
			.append(textOutput(tileMatrixSet.getContents()));

	output.append("\n\nTile Matrix Set\n\n")
			.append(textOutput(tileMatrixSet));

	output.append("\n\n Tile Matrices");

	for (long zoom = minZoom; zoom <= maxZoom; zoom++) {
		TileMatrix tileMatrix = tileDao.getTileMatrix(zoom);
		if (tileMatrix != null) {
			output.append("\n\n").append(textOutput(tileMatrix));
			output.append("\n\tTiles: " + tileDao.count(zoom));
			BoundingBox boundingBox = tileDao.getBoundingBox(zoom);
			output.append("\n\tTile Bounds: \n")
					.append(textOutput(boundingBox));
		}
	}

	return output.toString();
}