当前位置: 首页>>代码示例>>Java>>正文


Java TileDao.getTileMatrices方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:38,代码来源:TileProperties.java

示例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);

            }

        }

    }

}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:53,代码来源:TileUtils.java

示例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);

			}

		}

	}

}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:53,代码来源:TileUtils.java


注:本文中的mil.nga.geopackage.tiles.user.TileDao.getTileMatrices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。