Java源码示例:mil.nga.geopackage.extension.scale.TileScalingDao
示例1
/**
* Delete the Tile Scaling extensions for the table
*
* @param geoPackage
* GeoPackage
* @param table
* table name
* @since 2.0.2
*/
public static void deleteTileScaling(GeoPackageCore geoPackage,
String table) {
TileScalingDao tileScalingDao = geoPackage.getTileScalingDao();
ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();
try {
if (tileScalingDao.isTableExists()) {
tileScalingDao.deleteById(table);
}
if (extensionsDao.isTableExists()) {
extensionsDao.deleteByExtension(TileTableScaling.EXTENSION_NAME,
table);
}
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to delete Tile Scaling. GeoPackage: "
+ geoPackage.getName() + ", Table: " + table,
e);
}
}
示例2
/**
* Delete the Tile Scaling extension including the extension entries and
* custom tables
*
* @param geoPackage
* GeoPackage
* @since 3.2.0
*/
public static void deleteTileScalingExtension(GeoPackageCore geoPackage) {
TileScalingDao tileScalingDao = geoPackage.getTileScalingDao();
ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();
try {
if (tileScalingDao.isTableExists()) {
geoPackage.dropTable(tileScalingDao.getTableName());
}
if (extensionsDao.isTableExists()) {
extensionsDao
.deleteByExtension(TileTableScaling.EXTENSION_NAME);
}
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to delete Tile Scaling extension and table. GeoPackage: "
+ geoPackage.getName(),
e);
}
}
示例3
/**
* {@inheritDoc}
*/
@Override
public boolean createTileScalingTable() {
verifyWritable();
boolean created = false;
TileScalingDao dao = getTileScalingDao();
try {
if (!dao.isTableExists()) {
created = tableCreator.createTileScaling() > 0;
}
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to check if " + TileScaling.class.getSimpleName()
+ " table exists and create it",
e);
}
return created;
}
示例4
/**
* {@inheritDoc}
*/
@Override
public TileScalingDao getTileScalingDao() {
return createDao(TileScaling.class);
}
示例5
/**
* Get a Tile Scaling DAO
*
* @return tile scaling dao
* @since 2.0.2
*/
public TileScalingDao getTileScalingDao();