本文整理汇总了Java中mil.nga.geopackage.tiles.user.TileDao.getTileMatrices方法的典型用法代码示例。如果您正苦于以下问题:Java TileDao.getTileMatrices方法的具体用法?Java TileDao.getTileMatrices怎么用?Java TileDao.getTileMatrices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mil.nga.geopackage.tiles.user.TileDao
的用法示例。
在下文中一共展示了TileDao.getTileMatrices方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeFile
import mil.nga.geopackage.tiles.user.TileDao; //导入方法依赖的package包/类
/**
* Write the properties file using the tile dao
*
* @param tileDao
*/
public void writeFile(TileDao tileDao) {
try {
PrintWriter pw = new PrintWriter(propertiesFile);
TileMatrixSet tileMatrixSet = tileDao.getTileMatrixSet();
pw.println(GEOPACKAGE_PROPERTIES_EPSG + "="
+ tileMatrixSet.getSrs().getOrganizationCoordsysId());
pw.println(GEOPACKAGE_PROPERTIES_MIN_X + "="
+ tileMatrixSet.getMinX());
pw.println(GEOPACKAGE_PROPERTIES_MAX_X + "="
+ tileMatrixSet.getMaxX());
pw.println(GEOPACKAGE_PROPERTIES_MIN_Y + "="
+ tileMatrixSet.getMinY());
pw.println(GEOPACKAGE_PROPERTIES_MAX_Y + "="
+ tileMatrixSet.getMaxY());
for (TileMatrix tileMatrix : tileDao.getTileMatrices()) {
long zoom = tileMatrix.getZoomLevel();
pw.println(getMatrixWidthProperty(zoom) + "="
+ tileMatrix.getMatrixWidth());
pw.println(getMatrixHeightProperty(zoom) + "="
+ tileMatrix.getMatrixHeight());
}
pw.close();
} catch (FileNotFoundException e) {
throw new GeoPackageException(
"GeoPackage file format properties file could not be created: "
+ propertiesFile, e);
}
}
示例2: testGetZoomLevel
import mil.nga.geopackage.tiles.user.TileDao; //导入方法依赖的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);
}
}
}
}
示例3: testGetZoomLevel
import mil.nga.geopackage.tiles.user.TileDao; //导入方法依赖的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);
}
}
}
}