本文整理汇总了Java中mil.nga.geopackage.GeoPackage.getTileMatrixSetDao方法的典型用法代码示例。如果您正苦于以下问题:Java GeoPackage.getTileMatrixSetDao方法的具体用法?Java GeoPackage.getTileMatrixSetDao怎么用?Java GeoPackage.getTileMatrixSetDao使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mil.nga.geopackage.GeoPackage
的用法示例。
在下文中一共展示了GeoPackage.getTileMatrixSetDao方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getElevation
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevation at the coordinate
*
* @param geoPackage GeoPackage
* @param algorithm algorithm
* @param latitude latitude
* @param longitude longitude
* @return elevation
* @throws Exception
*/
public static Double getElevation(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, double latitude,
double longitude, long epsg) throws Exception {
Double elevation = null;
List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesPng elevationTiles = new ElevationTilesPng(geoPackage,
tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevation = elevationTiles.getElevation(latitude, longitude);
}
return elevation;
}
示例2: getElevations
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevations for the bounding box
*
* @param geoPackage GeoPackage
* @param algorithm algorithm
* @param boundingBox bounding box
* @param width results width
* @param width results height
* @return elevation tile results
* @throws Exception
*/
public static ElevationTileResults getElevations(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, BoundingBox boundingBox,
int width, int height, long epsg) throws Exception {
ElevationTileResults elevations = null;
List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesPng elevationTiles = new ElevationTilesPng(geoPackage,
tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevationTiles.setWidth(width);
elevationTiles.setHeight(height);
elevations = elevationTiles.getElevations(boundingBox);
}
return elevations;
}
示例3: getElevation
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevation at the coordinate
*
* @param geoPackage GeoPackage
* @param algorithm algorithm
* @param latitude latitude
* @param longitude longitude
* @return elevation
* @throws Exception
*/
public static Double getElevation(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, double latitude,
double longitude, long epsg) throws Exception {
Double elevation = null;
List<String> elevationTables = ElevationTilesTiff.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesTiff elevationTiles = new ElevationTilesTiff(
geoPackage, tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevation = elevationTiles.getElevation(latitude, longitude);
}
return elevation;
}
示例4: getElevations
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevations for the bounding box
*
* @param geoPackage GeoPackage
* @param algorithm algorithm
* @param boundingBox bounding box
* @param width results width
* @param width results height
* @return elevation tile results
* @throws Exception
*/
public static ElevationTileResults getElevations(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, BoundingBox boundingBox,
int width, int height, long epsg) throws Exception {
ElevationTileResults elevations = null;
List<String> elevationTables = ElevationTilesTiff.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesTiff elevationTiles = new ElevationTilesTiff(
geoPackage, tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevationTiles.setWidth(width);
elevationTiles.setHeight(height);
elevations = elevationTiles.getElevations(boundingBox);
}
return elevations;
}
示例5: getElevation
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevation at the coordinate
*
* @param geoPackage
* GeoPackage
* @param algorithm
* algorithm
* @param latitude
* latitude
* @param longitude
* longitude
* @return elevation
* @throws Exception
*/
public static Double getElevation(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, double latitude,
double longitude, long epsg) throws Exception {
Double elevation = null;
List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesPng elevationTiles = new ElevationTilesPng(
geoPackage, tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevation = elevationTiles.getElevation(latitude, longitude);
}
return elevation;
}
示例6: getElevations
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevations for the bounding box
*
* @param geoPackage
* GeoPackage
* @param algorithm
* algorithm
* @param boundingBox
* bounding box
* @param width
* results width
* @param height
* results height
* @return elevation tile results
* @throws Exception
*/
public static ElevationTileResults getElevations(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, BoundingBox boundingBox,
int width, int height, long epsg) throws Exception {
ElevationTileResults elevations = null;
List<String> elevationTables = ElevationTilesPng.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesPng elevationTiles = new ElevationTilesPng(
geoPackage, tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevationTiles.setWidth(width);
elevationTiles.setHeight(height);
elevations = elevationTiles.getElevations(boundingBox);
}
return elevations;
}
示例7: getElevation
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevation at the coordinate
*
* @param geoPackage
* GeoPackage
* @param algorithm
* algorithm
* @param latitude
* latitude
* @param longitude
* longitude
* @return elevation
* @throws Exception
*/
public static Double getElevation(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, double latitude,
double longitude, long epsg) throws Exception {
Double elevation = null;
List<String> elevationTables = ElevationTilesTiff.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesTiff elevationTiles = new ElevationTilesTiff(
geoPackage, tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevation = elevationTiles.getElevation(latitude, longitude);
}
return elevation;
}
示例8: getElevations
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Get the elevations for the bounding box
*
* @param geoPackage
* GeoPackage
* @param algorithm
* algorithm
* @param boundingBox
* bounding box
* @param width
* results width
* @param height
* results height
* @return elevation tile results
* @throws Exception
*/
public static ElevationTileResults getElevations(GeoPackage geoPackage,
ElevationTilesAlgorithm algorithm, BoundingBox boundingBox,
int width, int height, long epsg) throws Exception {
ElevationTileResults elevations = null;
List<String> elevationTables = ElevationTilesTiff.getTables(geoPackage);
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
for (String elevationTable : elevationTables) {
TileMatrixSet tileMatrixSet = dao.queryForId(elevationTable);
TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
Projection requestProjection = ProjectionFactory
.getProjection(epsg);
// Test getting the elevation of a single coordinate
ElevationTilesTiff elevationTiles = new ElevationTilesTiff(
geoPackage, tileDao, requestProjection);
elevationTiles.setAlgorithm(algorithm);
elevationTiles.setWidth(width);
elevationTiles.setHeight(height);
elevations = elevationTiles.getElevations(boundingBox);
}
return elevations;
}
示例9: testDelete
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Test delete
*
* @param geoPackage
* @throws SQLException
*/
public static void testDelete(GeoPackage geoPackage) throws SQLException {
TileMatrixSetDao tileMatrixSetDao = geoPackage.getTileMatrixSetDao();
if (tileMatrixSetDao.isTableExists()) {
List<TileMatrixSet> results = tileMatrixSetDao.queryForAll();
for (TileMatrixSet tileMatrixSet : results) {
TileDao dao = geoPackage.getTileDao(tileMatrixSet);
TestCase.assertNotNull(dao);
TileResultSet cursor = dao.queryForAll();
int count = cursor.getCount();
if (count > 0) {
// Choose random tile
int random = (int) (Math.random() * count);
cursor.moveToPosition(random);
TileRow tileRow = cursor.getRow();
cursor.close();
// Delete row
TestCase.assertEquals(1, dao.delete(tileRow));
// Verify deleted
TileRow queryTileRow = dao.queryForIdRow(tileRow.getId());
TestCase.assertNull(queryTileRow);
cursor = dao.queryForAll();
TestCase.assertEquals(count - 1, cursor.getCount());
cursor.close();
}
cursor.close();
}
}
}
示例10: testDelete
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Test delete
*
* @param geoPackage
* @throws SQLException
*/
public static void testDelete(GeoPackage geoPackage) throws SQLException {
TileMatrixSetDao dao = geoPackage.getTileMatrixSetDao();
if (dao.isTableExists()) {
List<TileMatrixSet> results = dao.queryForAll();
if (!results.isEmpty()) {
// Choose random tile matrix set
int random = (int) (Math.random() * results.size());
TileMatrixSet tileMatrixSet = results.get(random);
// Delete the tile matrix set
dao.delete(tileMatrixSet);
// Verify deleted
TileMatrixSet queryTileMatrixSet = dao.queryForId(tileMatrixSet
.getId());
TestCase.assertNull(queryTileMatrixSet);
// Prepared deleted
results = dao.queryForAll();
if (!results.isEmpty()) {
// Choose random tile matrix set
random = (int) (Math.random() * results.size());
tileMatrixSet = results.get(random);
// Find which tile matrix set to delete
QueryBuilder<TileMatrixSet, String> qb = dao.queryBuilder();
qb.where().eq(TileMatrixSet.COLUMN_SRS_ID,
tileMatrixSet.getSrsId());
PreparedQuery<TileMatrixSet> query = qb.prepare();
List<TileMatrixSet> queryResults = dao.query(query);
int count = queryResults.size();
// Delete
DeleteBuilder<TileMatrixSet, String> db = dao
.deleteBuilder();
db.where().eq(TileMatrixSet.COLUMN_SRS_ID,
tileMatrixSet.getSrsId());
PreparedDelete<TileMatrixSet> deleteQuery = db.prepare();
int deleted = dao.delete(deleteQuery);
TestCase.assertEquals(count, deleted);
}
}
}
}
示例11: testDelete
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Test delete
*
* @param geoPackage
* @throws SQLException
*/
public static void testDelete(GeoPackage geoPackage) throws SQLException {
TileMatrixSetDao tileMatrixSetDao = geoPackage.getTileMatrixSetDao();
if (tileMatrixSetDao.isTableExists()) {
List<TileMatrixSet> results = tileMatrixSetDao.queryForAll();
for (TileMatrixSet tileMatrixSet : results) {
TileDao dao = geoPackage.getTileDao(tileMatrixSet);
TestCase.assertNotNull(dao);
TileCursor cursor = dao.queryForAll();
int count = cursor.getCount();
if (count > 0) {
// Choose random tile
int random = (int) (Math.random() * count);
cursor.moveToPosition(random);
TileRow tileRow = cursor.getRow();
cursor.close();
// Delete row
try {
TestCase.assertEquals(1, dao.delete(tileRow));
} catch (SQLiteException e) {
if (TestUtils.isFutureSQLiteException(e)) {
continue;
} else {
throw e;
}
}
// Verify deleted
TileRow queryTileRow = dao.queryForIdRow(tileRow.getId());
TestCase.assertNull(queryTileRow);
cursor = dao.queryForAll();
TestCase.assertEquals(count - 1, cursor.getCount());
cursor.close();
}
cursor.close();
}
}
}
示例12: testDeleteTables
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Test deleting tables by name
*
* @param geoPackage
* @throws SQLException
*/
public static void testDeleteTables(GeoPackage geoPackage)
throws SQLException {
GeometryColumnsDao geometryColumnsDao = geoPackage
.getGeometryColumnsDao();
TileMatrixSetDao tileMatrixSetDao = geoPackage.getTileMatrixSetDao();
TestCase.assertTrue(geometryColumnsDao.isTableExists()
|| tileMatrixSetDao.isTableExists());
if (geometryColumnsDao.isTableExists()) {
for (String featureTable : geoPackage.getFeatureTables()) {
FeatureDao featureDao = geoPackage.getFeatureDao(featureTable);
featureDao.dropTable();
}
geoPackage.dropTable(GeometryColumns.TABLE_NAME);
TestCase.assertFalse(geometryColumnsDao.isTableExists());
}
if (tileMatrixSetDao.isTableExists()) {
TileMatrixDao tileMatrixDao = geoPackage.getTileMatrixDao();
TestCase.assertTrue(tileMatrixSetDao.isTableExists());
TestCase.assertTrue(tileMatrixDao.isTableExists());
for (String tileTable : geoPackage.getTileTables()) {
TileDao tileDao = geoPackage.getTileDao(tileTable);
tileDao.dropTable();
}
geoPackage.dropTable(TileMatrix.TABLE_NAME);
geoPackage.dropTable(TileMatrixSet.TABLE_NAME);
TestCase.assertFalse(tileMatrixSetDao.isTableExists());
TestCase.assertFalse(tileMatrixDao.isTableExists());
}
}
示例13: testOverlay
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Test overlay
*
* @param geoPackage
* @throws SQLException
*/
public static void testOverlay(GeoPackage geoPackage) throws SQLException {
TileMatrixSetDao tileMatrixSetDao = geoPackage.getTileMatrixSetDao();
if (tileMatrixSetDao.isTableExists()) {
List<TileMatrixSet> results = tileMatrixSetDao.queryForAll();
for (TileMatrixSet tileMatrixSet : results) {
TileDao dao = geoPackage.getTileDao(tileMatrixSet);
GeoPackageOverlay overlay = new GeoPackageOverlay(dao);
for (int zoom = 0; zoom <= 21; zoom++) {
int tileLength = (int) Math.pow(2, zoom);
int column = (int) (Math.random() * tileLength);
int row = (int) (Math.random() * tileLength);
for (int maxColumns = Math.min(tileLength, column + 2); column < maxColumns; column++) {
for (int maxRows = Math.min(tileLength, row + 2); row < maxRows; row++) {
Tile tile = overlay.getTile(column, row, zoom);
if (tile != null) {
TestCase.assertTrue(tile.height > 0);
TestCase.assertTrue(tile.width > 0);
}
}
}
}
}
}
}
示例14: testGetZoomLevel
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Test getZoomLevel
*
* @param geoPackage
* @throws SQLException
*/
public static void testGetZoomLevel(GeoPackage geoPackage)
throws SQLException {
TileMatrixSetDao tileMatrixSetDao = geoPackage.getTileMatrixSetDao();
if (tileMatrixSetDao.isTableExists()) {
List<TileMatrixSet> results = tileMatrixSetDao.queryForAll();
for (TileMatrixSet tileMatrixSet : results) {
TileDao dao = geoPackage.getTileDao(tileMatrixSet);
List<TileMatrix> tileMatrices = dao.getTileMatrices();
for (TileMatrix tileMatrix : tileMatrices) {
double width = tileMatrix.getPixelXSize()
* tileMatrix.getTileWidth();
double height = tileMatrix.getPixelYSize()
* tileMatrix.getTileHeight();
long zoomLevel = dao.getZoomLevel(width);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width, height);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width + 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width + 1, height + 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width - 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width - 1, height - 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
}
}
}
}
示例15: testGetZoomLevel
import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
* Test getZoomLevel
*
* @param geoPackage
* @throws SQLException
*/
public static void testGetZoomLevel(GeoPackage geoPackage)
throws SQLException {
TileMatrixSetDao tileMatrixSetDao = geoPackage.getTileMatrixSetDao();
if (tileMatrixSetDao.isTableExists()) {
List<TileMatrixSet> results = tileMatrixSetDao.queryForAll();
for (TileMatrixSet tileMatrixSet : results) {
TileDao dao = geoPackage.getTileDao(tileMatrixSet);
List<TileMatrix> tileMatrices = dao.getTileMatrices();
for (TileMatrix tileMatrix : tileMatrices) {
double width = tileMatrix.getPixelXSize()
* tileMatrix.getTileWidth();
double height = tileMatrix.getPixelYSize()
* tileMatrix.getTileHeight();
long zoomLevel = dao.getZoomLevel(width);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width, height);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width + 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width + 1, height + 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width - 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
zoomLevel = dao.getZoomLevel(width - 1, height - 1);
TestCase.assertEquals(tileMatrix.getZoomLevel(), zoomLevel);
}
}
}
}