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


Java GeoPackage.getTileDao方法代码示例

本文整理汇总了Java中mil.nga.geopackage.GeoPackage.getTileDao方法的典型用法代码示例。如果您正苦于以下问题:Java GeoPackage.getTileDao方法的具体用法?Java GeoPackage.getTileDao怎么用?Java GeoPackage.getTileDao使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mil.nga.geopackage.GeoPackage的用法示例。


在下文中一共展示了GeoPackage.getTileDao方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTileTableWithMetadata

import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
 * Create the elevation tile table with metadata and extension
 *
 * @param geoPackage
 * @param tableName
 * @param contentsBoundingBox
 * @param contentsSrsId
 * @param tileMatrixSetBoundingBox
 * @param tileMatrixSetSrsId
 * @return elevation tiles
 */
public static ElevationTilesPng createTileTableWithMetadata(
        GeoPackage geoPackage, String tableName,
        BoundingBox contentsBoundingBox, long contentsSrsId,
        BoundingBox tileMatrixSetBoundingBox, long tileMatrixSetSrsId) {

    TileMatrixSet tileMatrixSet = ElevationTilesCore
            .createTileTableWithMetadata(geoPackage, tableName,
                    contentsBoundingBox, contentsSrsId,
                    tileMatrixSetBoundingBox, tileMatrixSetSrsId);
    TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
    ElevationTilesPng elevationTiles = new ElevationTilesPng(geoPackage, tileDao);
    elevationTiles.getOrCreate();

    return elevationTiles;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:27,代码来源:ElevationTilesPng.java

示例2: createTileTableWithMetadata

import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
 * Create the elevation tile table with metadata and extension
 * 
 * @param geoPackage
 * @param tableName
 * @param contentsBoundingBox
 * @param contentsSrsId
 * @param tileMatrixSetBoundingBox
 * @param tileMatrixSetSrsId
 * @return elevation tiles
 */
public static ElevationTilesPng createTileTableWithMetadata(
		GeoPackage geoPackage, String tableName,
		BoundingBox contentsBoundingBox, long contentsSrsId,
		BoundingBox tileMatrixSetBoundingBox, long tileMatrixSetSrsId) {

	TileMatrixSet tileMatrixSet = ElevationTilesCore
			.createTileTableWithMetadata(geoPackage, tableName,
					contentsBoundingBox, contentsSrsId,
					tileMatrixSetBoundingBox, tileMatrixSetSrsId);
	TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
	ElevationTilesPng elevationTiles = new ElevationTilesPng(geoPackage,
			tileDao);
	elevationTiles.getOrCreate();

	return elevationTiles;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:28,代码来源:ElevationTilesPng.java

示例3: createTileTableWithMetadata

import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
 * Create the elevation tile table with metadata and extension
 *
 * @param geoPackage
 * @param tableName
 * @param contentsBoundingBox
 * @param contentsSrsId
 * @param tileMatrixSetBoundingBox
 * @param tileMatrixSetSrsId
 * @return elevation tiles
 */
public static ElevationTilesTiff createTileTableWithMetadata(
		GeoPackage geoPackage, String tableName,
		BoundingBox contentsBoundingBox, long contentsSrsId,
		BoundingBox tileMatrixSetBoundingBox, long tileMatrixSetSrsId) {

	TileMatrixSet tileMatrixSet = ElevationTilesCore
			.createTileTableWithMetadata(geoPackage, tableName,
					contentsBoundingBox, contentsSrsId,
					tileMatrixSetBoundingBox, tileMatrixSetSrsId);
	TileDao tileDao = geoPackage.getTileDao(tileMatrixSet);
	ElevationTilesTiff elevationTiles = new ElevationTilesTiff(geoPackage,
			tileDao);
	elevationTiles.getOrCreate();

	return elevationTiles;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:28,代码来源:ElevationTilesTiff.java

示例4: 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;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:37,代码来源:ElevationTilesPngTestUtils.java

示例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 = 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;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:37,代码来源:ElevationTilesTiffTestUtils.java

示例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 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;
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:40,代码来源:ElevationTilesTiffTestUtils.java

示例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 = 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;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:41,代码来源:ElevationTilesPngTestUtils.java

示例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 = 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;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:45,代码来源:ElevationTilesPngTestUtils.java

示例9: 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;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:41,代码来源:ElevationTilesTiffTestUtils.java

示例10: 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;
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:45,代码来源:ElevationTilesTiffTestUtils.java

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

			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();
		}

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

示例12: addRowsToTileTable

import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
 * Add rows to the tile table
 *
 * @param geoPackage
 * @param tileMatrix
 * @param tileData
 */
public static void addRowsToTileTable(GeoPackage geoPackage,
                                      TileMatrix tileMatrix, byte[] tileData) {

    TileDao dao = geoPackage.getTileDao(tileMatrix.getTableName());

    for (int column = 0; column < tileMatrix.getMatrixWidth(); column++) {

        for (int row = 0; row < tileMatrix.getMatrixHeight(); row++) {

            TileRow newRow = dao.newRow();

            newRow.setZoomLevel(tileMatrix.getZoomLevel());
            newRow.setTileColumn(column);
            newRow.setTileRow(row);
            newRow.setTileData(tileData);

            dao.create(newRow);
        }

    }

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

示例13: testGenerateTiles

import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
 * Test generating tiles
 * 
 * @param tileGenerator
 * @throws SQLException
 * @throws IOException
 */
private static void testGenerateTiles(TileGenerator tileGenerator)
		throws SQLException, IOException {

	GeoPackage geoPackage = tileGenerator.getGeoPackage();
	String tableName = tileGenerator.getTableName();
	int minZoom = tileGenerator.getMinZoom();
	int maxZoom = tileGenerator.getMaxZoom();
	BoundingBox webMercatorBoundingBox = tileGenerator.getBoundingBox();

	TestGeoPackageProgress progress = new TestGeoPackageProgress();
	tileGenerator.setProgress(progress);

	int count = tileGenerator.generateTiles();

	long expected = expectedTiles(webMercatorBoundingBox, minZoom, maxZoom);
	TestCase.assertEquals(expected, count);
	TestCase.assertEquals(expected, progress.getProgress());

	TileDao tileDao = geoPackage.getTileDao(tableName);
	TestCase.assertEquals(expected, tileDao.count());
	TestCase.assertEquals(minZoom, tileDao.getMinZoom());
	TestCase.assertEquals(maxZoom, tileDao.getMaxZoom());

	BoundingBox tileMatrixSetBoundingBox = tileDao.getBoundingBox();

	for (int zoom = minZoom; zoom <= maxZoom; zoom++) {
		TileGrid expectedTileGrid = TileBoundingBoxUtils.getTileGrid(
				webMercatorBoundingBox, zoom);
		BoundingBox expectedBoundingBox = TileBoundingBoxUtils
				.getWebMercatorBoundingBox(expectedTileGrid, zoom);
		BoundingBox zoomBoundingBox = tileDao.getBoundingBox(zoom);
		TestCase.assertEquals(expectedBoundingBox.getMinLongitude(),
				zoomBoundingBox.getMinLongitude(), .000001);
		TestCase.assertEquals(expectedBoundingBox.getMaxLongitude(),
				zoomBoundingBox.getMaxLongitude(), .000001);
		TestCase.assertEquals(expectedBoundingBox.getMinLatitude(),
				zoomBoundingBox.getMinLatitude(), .000001);
		TestCase.assertEquals(expectedBoundingBox.getMaxLatitude(),
				zoomBoundingBox.getMaxLatitude(), .000001);
		long expectedZoomTiles = expectedTiles(webMercatorBoundingBox, zoom);
		TestCase.assertEquals(expectedZoomTiles, tileDao.count(zoom));

		TileMatrix tileMatrix = tileDao.getTileMatrix(zoom);

		TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
				tileMatrixSetBoundingBox, tileMatrix.getMatrixWidth(),
				tileMatrix.getMatrixHeight(), zoomBoundingBox);

		TestCase.assertTrue(tileGrid.getMinX() >= 0);
		TestCase.assertTrue(tileGrid.getMaxX() < tileMatrix
				.getMatrixWidth());
		TestCase.assertTrue(tileGrid.getMinY() >= 0);
		TestCase.assertTrue(tileGrid.getMaxY() < tileMatrix
				.getMatrixHeight());

		TileResultSet resultSet = tileDao.queryForTile(zoom);
		TestCase.assertEquals(expectedZoomTiles, resultSet.getCount());
		int resultCount = 0;
		while (resultSet.moveToNext()) {
			TileRow tileRow = resultSet.getRow();
			resultCount++;
			byte[] tileData = tileRow.getTileData();
			TestCase.assertNotNull(tileData);
			BufferedImage image = tileRow.getTileDataImage();
			TestCase.assertNotNull(image);
			TestCase.assertEquals(tileMatrix.getTileWidth(),
					image.getWidth());
			TestCase.assertEquals(tileMatrix.getTileHeight(),
					image.getHeight());
		}
		TestCase.assertEquals(expectedZoomTiles, resultCount);
	}

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

示例14: addRowsToTileTable

import mil.nga.geopackage.GeoPackage; //导入方法依赖的package包/类
/**
 * Add rows to the tile table
 *
 * @param geoPackage
 * @param tileMatrix
 * @param tileData
 */
public static void addRowsToTileTable(GeoPackage geoPackage,
		TileMatrix tileMatrix, byte[] tileData) {

	TileDao dao = geoPackage.getTileDao(tileMatrix.getTableName());

	for (int column = 0; column < tileMatrix.getMatrixWidth(); column++) {

		for (int row = 0; row < tileMatrix.getMatrixHeight(); row++) {

			TileRow newRow = dao.newRow();

			newRow.setZoomLevel(tileMatrix.getZoomLevel());
			newRow.setTileColumn(column);
			newRow.setTileRow(row);
			newRow.setTileData(tileData);

			dao.create(newRow);
		}

	}

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

示例15: 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();
        }

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


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