本文整理匯總了Java中mil.nga.geopackage.tiles.TileGrid類的典型用法代碼示例。如果您正苦於以下問題:Java TileGrid類的具體用法?Java TileGrid怎麽用?Java TileGrid使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TileGrid類屬於mil.nga.geopackage.tiles包,在下文中一共展示了TileGrid類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: retrieveSortedTileResults
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Get the tile row results of elevation tiles needed to create the
* requested bounding box elevations, sorted by row and then column
*
* @param projectedRequestBoundingBox bounding box projected to the elevations
* @param tileMatrix tile matrix
* @return tile results or null
*/
private TileCursor retrieveSortedTileResults(
BoundingBox projectedRequestBoundingBox, TileMatrix tileMatrix) {
TileCursor tileResults = null;
if (tileMatrix != null) {
// Get the tile grid
TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
elevationBoundingBox, tileMatrix.getMatrixWidth(),
tileMatrix.getMatrixHeight(), projectedRequestBoundingBox);
// Query for matching tiles in the tile grid
tileResults = tileDao.queryByTileGrid(tileGrid,
tileMatrix.getZoomLevel(), TileTable.COLUMN_TILE_ROW + ","
+ TileTable.COLUMN_TILE_COLUMN);
}
return tileResults;
}
示例2: retrieveTileResults
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Get the tile row results of tiles needed to draw the requested bounding box tile
*
* @param projectedRequestBoundingBox bounding box projected to the tiles
* @param tileMatrix
* @return tile cursor results or null
*/
private TileCursor retrieveTileResults(BoundingBox projectedRequestBoundingBox, TileMatrix tileMatrix) {
TileCursor tileResults = null;
if (tileMatrix != null) {
// Get the tile grid
TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
tileSetBoundingBox, tileMatrix.getMatrixWidth(),
tileMatrix.getMatrixHeight(), projectedRequestBoundingBox);
// Query for matching tiles in the tile grid
tileResults = tileDao.queryByTileGrid(tileGrid,
tileMatrix.getZoomLevel());
}
return tileResults;
}
示例3: retrieveSortedTileResults
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Get the tile row results of elevation tiles needed to create the
* requested bounding box elevations, sorted by row and then column
*
* @param projectedRequestBoundingBox
* bounding box projected to the elevations
* @param tileMatrix
* tile matrix
* @return tile results or null
*/
private TileResultSet retrieveSortedTileResults(
BoundingBox projectedRequestBoundingBox, TileMatrix tileMatrix) {
TileResultSet tileResults = null;
if (tileMatrix != null) {
// Get the tile grid
TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
elevationBoundingBox, tileMatrix.getMatrixWidth(),
tileMatrix.getMatrixHeight(), projectedRequestBoundingBox);
// Query for matching tiles in the tile grid
tileResults = tileDao.queryByTileGrid(tileGrid,
tileMatrix.getZoomLevel(), TileTable.COLUMN_TILE_ROW + ","
+ TileTable.COLUMN_TILE_COLUMN);
}
return tileResults;
}
示例4: isOnAtCurrentZoom
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Determine if the feature overlay is on for the provided zoom level at the location
*
* @param zoom zoom level
* @param latLng lat lon location
* @return true if on
* @since 1.2.6
*/
public boolean isOnAtCurrentZoom(double zoom, LatLng latLng) {
Point point = new Point(latLng.longitude, latLng.latitude);
TileGrid tileGrid = TileBoundingBoxUtils.getTileGridFromWGS84(point, (int) zoom);
boolean on = boundedOverlay.hasTile((int) tileGrid.getMinX(), (int) tileGrid.getMinY(), (int) zoom);
return on;
}
示例5: getBoundingBox
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Get the bounding box of tiles
*
* @param zoomLevel zoom level
* @return bounding box of zoom level, or null if no tiles
* @since 1.1.1
*/
public BoundingBox getBoundingBox(long zoomLevel) {
BoundingBox boundingBox = null;
TileMatrix tileMatrix = getTileMatrix(zoomLevel);
if (tileMatrix != null) {
TileGrid tileGrid = queryForTileGrid(zoomLevel);
if (tileGrid != null) {
BoundingBox matrixSetBoundingBox = getBoundingBox();
boundingBox = TileBoundingBoxUtils.getBoundingBox(
matrixSetBoundingBox, tileMatrix, tileGrid);
}
}
return boundingBox;
}
示例6: queryByTileGrid
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Query by tile grid and zoom level
*
* @param tileGrid
* tile grid
* @param zoomLevel
* zoom level
* @param orderBy
* order by
* @return cursor from query or null if the zoom level tile ranges do not
* overlap the bounding box
* @since 1.3.1
*/
public TileCursor queryByTileGrid(TileGrid tileGrid, long zoomLevel,
String orderBy) {
TileCursor tileCursor = null;
if (tileGrid != null) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_COLUMN,
tileGrid.getMinX(), ">="));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_COLUMN,
tileGrid.getMaxX(), "<="));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_ROW,
tileGrid.getMinY(), ">="));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_ROW,
tileGrid.getMaxY(), "<="));
String[] whereArgs = buildWhereArgs(new Object[]{zoomLevel,
tileGrid.getMinX(), tileGrid.getMaxX(), tileGrid.getMinY(),
tileGrid.getMaxY()});
tileCursor = query(where.toString(), whereArgs, null, null, orderBy);
}
return tileCursor;
}
示例7: getBoundingBox
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Get the bounding box of tiles
*
* @param zoomLevel
* zoom level
* @return bounding box of zoom level, or null if no tiles
* @since 1.1.1
*/
public BoundingBox getBoundingBox(long zoomLevel) {
BoundingBox boundingBox = null;
TileMatrix tileMatrix = getTileMatrix(zoomLevel);
if (tileMatrix != null) {
TileGrid tileGrid = queryForTileGrid(zoomLevel);
if (tileGrid != null) {
BoundingBox matrixSetBoundingBox = getBoundingBox();
boundingBox = TileBoundingBoxUtils.getBoundingBox(
matrixSetBoundingBox, tileMatrix, tileGrid);
}
}
return boundingBox;
}
示例8: queryByTileGrid
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Query by tile grid and zoom level
*
* @param tileGrid
* tile grid
* @param zoomLevel
* zoom level
* @param orderBy
* order by
* @return cursor from query or null if the zoom level tile ranges do not
* overlap the bounding box
* @since 1.2.1
*/
public TileResultSet queryByTileGrid(TileGrid tileGrid, long zoomLevel,
String orderBy) {
TileResultSet tileCursor = null;
if (tileGrid != null) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_COLUMN,
tileGrid.getMinX(), ">="));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_COLUMN,
tileGrid.getMaxX(), "<="));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_ROW,
tileGrid.getMinY(), ">="));
where.append(" AND ");
where.append(buildWhere(TileTable.COLUMN_TILE_ROW,
tileGrid.getMaxY(), "<="));
String[] whereArgs = buildWhereArgs(new Object[] { zoomLevel,
tileGrid.getMinX(), tileGrid.getMaxX(), tileGrid.getMinY(),
tileGrid.getMaxY() });
tileCursor = query(where.toString(), whereArgs, null, null, orderBy);
}
return tileCursor;
}
示例9: testGenerateTiles
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的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);
}
}
示例10: expectedTiles
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Expected number of XYZ tiles at zoom and bounding box
*
* @param webMercatorBoundingBox
* @param zoom
* @return
*/
private static long expectedTiles(BoundingBox webMercatorBoundingBox,
int zoom) {
TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
webMercatorBoundingBox, zoom);
return tileGrid.count();
}
示例11: tileFeatureCount
import mil.nga.geopackage.tiles.TileGrid; //導入依賴的package包/類
/**
* Get the count of features in the tile at the point coordinate and zoom level
*
* @param point point location
* @param zoom zoom level
* @return
*/
public long tileFeatureCount(Point point, int zoom) {
TileGrid tileGrid = TileBoundingBoxUtils.getTileGridFromWGS84(point, zoom);
return featureTiles.queryIndexedFeaturesCount((int) tileGrid.getMinX(), (int) tileGrid.getMinY(), zoom);
}