Package mil.nga.geopackage.tiles.user
Class TileDao
- java.lang.Object
-
- mil.nga.geopackage.user.UserCoreDao<TColumn,TTable,TRow,TResult>
-
- mil.nga.geopackage.user.UserDao<TileColumn,TileTable,TileRow,TileResultSet>
-
- mil.nga.geopackage.tiles.user.TileDao
-
public class TileDao extends UserDao<TileColumn,TileTable,TileRow,TileResultSet>
Tile DAO for reading tile user tables- Author:
- osbornb
-
-
Field Summary
-
Fields inherited from class mil.nga.geopackage.user.UserCoreDao
projection
-
-
Constructor Summary
Constructors Constructor Description TileDao(String database, GeoPackageConnection db, TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices, TileTable table)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adjustTileMatrixLengths()
Adjust the tile matrix lengths if needed.int
count(long zoomLevel)
Count of Tiles at a zoom levelint
deleteTile(long column, long row, long zoomLevel)
Delete a TileLong
getApproximateZoomLevel(double length)
Get the approximate zoom level for the provided length in the default units.Long
getApproximateZoomLevel(double width, double height)
Get the approximate zoom level for the provided width and height in the default units.BoundingBox
getBoundingBox()
BoundingBox
getBoundingBox(long zoomLevel)
Get the bounding box of tilesBoundingBox
getBoundingBox(long zoomLevel, Projection projection)
Get the bounding box of tiles at the zoom levelBoundingBox
getBoundingBox(Projection projection)
Long
getClosestZoomLevel(double length)
Get the closest zoom level for the provided width and height in the default unitsLong
getClosestZoomLevel(double width, double height)
Get the closest zoom level for the provided width and height in the default unitslong
getMapMaxZoom()
Get the map max zoom levellong
getMapMinZoom()
Get the map min zoom levellong
getMapZoom(long zoomLevel)
Get the map zoom level from the tile matrix zoom levellong
getMapZoom(TileMatrix tileMatrix)
Get the map zoom level from the tile matrixlong[]
getMapZoomRange()
Get the map zoom level rangedouble
getMaxLength()
Get the max length in default units that contains tileslong
getMaxZoom()
Get the max zoomdouble
getMinLength()
Get the min length in default units that contains tileslong
getMinZoom()
Get the min zoomSpatialReferenceSystem
getSrs()
Get the Spatial Reference Systemlong
getSrsId()
Get the Spatial Reference System idTileConnection
getTileDb()
Get the Tile connectionTileGrid
getTileGrid(long zoomLevel)
Get the tile grid of the zoom levelList<TileMatrix>
getTileMatrices()
Get the tile matricesTileMatrix
getTileMatrix(long zoomLevel)
Get the tile matrix at the zoom levelTileMatrix
getTileMatrixAtMinZoom()
Get the tile matrix at the min (first) zoomTileMatrixDao
getTileMatrixDao()
Get a tile matrix DAOTileMatrixSet
getTileMatrixSet()
Get the tile matrix setTileMatrixSetDao
getTileMatrixSetDao()
Get a tile matrix set DAOLong
getZoomLevel(double length)
Get the zoom level for the provided width and height in the default unitsLong
getZoomLevel(double width, double height)
Get the zoom level for the provided width and height in the default unitsSet<Long>
getZoomLevels()
Get the zoom levelsboolean
isXYZTiles()
Determine if the tiles are in the XYZ tile coordinate formatTileRow
newRow()
TileResultSet
queryByTileGrid(TileGrid tileGrid, long zoomLevel)
Query by tile grid and zoom levelTileResultSet
queryByTileGrid(TileGrid tileGrid, long zoomLevel, String orderBy)
Query by tile grid and zoom levelTileResultSet
queryForTile(long zoomLevel)
Query for Tiles at a zoom levelTileRow
queryForTile(long column, long row, long zoomLevel)
Query for a TileTileResultSet
queryForTileDescending(long zoomLevel)
Query for Tiles at a zoom level in descending row and column orderTileGrid
queryForTileGrid(long zoomLevel)
Query for the boundingTileResultSet
queryForTilesInColumn(long column, long zoomLevel)
Query for Tiles at a zoom level and columnTileResultSet
queryForTilesInRow(long row, long zoomLevel)
Query for Tiles at a zoom level and row-
Methods inherited from class mil.nga.geopackage.user.UserDao
beginTransaction, commit, endTransaction, getConnection, getDb, insert, insert, insertOrThrow, inTransaction, prepareResult, update, update
-
Methods inherited from class mil.nga.geopackage.user.UserCoreDao
addColumn, alterColumn, alterColumns, buildColumnsAs, buildColumnsAs, buildColumnsAs, buildColumnsAs, buildColumnsAs, buildColumnsAsNull, buildColumnsAsNull, buildLimit, buildValueWhere, buildValueWhereArgs, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhere, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereArgs, buildWhereIn, buildWhereInArgs, buildWhereLike, buildWhereLike, buildWhereNull, columnCount, count, count, count, count, count, count, count, count, countColumn, countColumnIn, countColumnIn, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForEq, countForFieldValues, countForFieldValues, countForFieldValues, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForLike, countForValueFieldValues, countForValueFieldValues, countForValueFieldValues, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, countIn, create, createDao, delete, delete, delete, deleteAll, deleteById, dropColumn, dropColumn, dropColumn, dropColumnIndexes, dropColumnNames, dropColumns, dropTable, endAndBeginTransaction, endTransaction, failTransaction, getColumnNames, getColumns, getContents, getDatabase, getPkColumn, getPkColumnIndex, getPkColumnName, getPkWhere, getPkWhereArgs, getProjection, getTable, getTableName, getUserDb, getXRange, getXRange, getYRange, getYRange, getZoomLevel, hasPkColumn, isPkModifiable, isValueValidation, max, max, min, min, projectBoundingBox, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, query, queryAs, queryAs, queryForAll, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForChunk, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForEq, queryForFieldValues, queryForFieldValues, queryForFieldValues, queryForFieldValues, queryForId, queryForId, queryForId, queryForId, queryForIdRow, queryForIdRow, queryForIdRow, queryForIdRow, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForLike, queryForValueFieldValues, queryForValueFieldValues, queryForValueFieldValues, queryForValueFieldValues, queryIdsSQL, queryIdsSQL, queryIdsSQL, queryIdsSQL, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryIn, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunk, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryInForChunkWhere, queryResults, queryResults, queryResults, queryResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleResult, querySingleResult, querySingleResult, querySingleResult, querySingleRowResults, querySingleRowResults, querySingleRowTypedResults, querySingleRowTypedResults, querySingleTypedResult, querySingleTypedResult, querySingleTypedResult, querySingleTypedResult, querySQL, querySQL, querySQL, querySQL, querySQL, querySQL, querySQL, querySQL, queryTypedResults, queryTypedResults, queryTypedResults, queryTypedResults, rawQuery, rawQuery, rawQuery, renameColumn, renameColumn, renameColumn, renameTableColumn, setPkModifiable, setValueValidation
-
-
-
-
Constructor Detail
-
TileDao
public TileDao(String database, GeoPackageConnection db, TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices, TileTable table)
Constructor- Parameters:
database
- databasedb
- GeoPackage connectiontileMatrixSet
- tile matrix settileMatrices
- tile matricestable
- tile table
-
-
Method Detail
-
getBoundingBox
public BoundingBox getBoundingBox()
- Specified by:
getBoundingBox
in classUserCoreDao<TileColumn,TileTable,TileRow,TileResultSet>
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection)
- Specified by:
getBoundingBox
in classUserCoreDao<TileColumn,TileTable,TileRow,TileResultSet>
-
getBoundingBox
public BoundingBox getBoundingBox(long zoomLevel)
Get the bounding box of tiles- Parameters:
zoomLevel
- zoom level- Returns:
- bounding box of zoom level, or null if no tiles
- Since:
- 1.1.1
-
getBoundingBox
public BoundingBox getBoundingBox(long zoomLevel, Projection projection)
Get the bounding box of tiles at the zoom level- Parameters:
zoomLevel
- zoom levelprojection
- desired projection- Returns:
- bounding box of zoom level, or nil if no tiles
- Since:
- 5.0.0
-
getTileGrid
public TileGrid getTileGrid(long zoomLevel)
Get the tile grid of the zoom level- Parameters:
zoomLevel
- zoom level- Returns:
- tile grid at zoom level, null if not tile matrix at zoom level
- Since:
- 1.1.1
-
adjustTileMatrixLengths
public void adjustTileMatrixLengths()
Adjust the tile matrix lengths if needed. Check if the tile matrix width and height need to expand to account for pixel * number of pixels fitting into the tile matrix lengths
-
newRow
public TileRow newRow()
- Specified by:
newRow
in classUserCoreDao<TileColumn,TileTable,TileRow,TileResultSet>
-
getTileDb
public TileConnection getTileDb()
Get the Tile connection- Returns:
- tile connection
-
getTileMatrixSet
public TileMatrixSet getTileMatrixSet()
Get the tile matrix set- Returns:
- tile matrix set
-
getTileMatrices
public List<TileMatrix> getTileMatrices()
Get the tile matrices- Returns:
- tile matrices
-
getZoomLevels
public Set<Long> getZoomLevels()
Get the zoom levels- Returns:
- zoom level set
- Since:
- 5.0.0
-
getTileMatrix
public TileMatrix getTileMatrix(long zoomLevel)
Get the tile matrix at the zoom level- Parameters:
zoomLevel
- zoom level- Returns:
- tile matrix
-
getTileMatrixAtMinZoom
public TileMatrix getTileMatrixAtMinZoom()
Get the tile matrix at the min (first) zoom- Returns:
- tile matrix
- Since:
- 5.0.0
-
getSrs
public SpatialReferenceSystem getSrs()
Get the Spatial Reference System- Returns:
- srs
- Since:
- 4.0.0
-
getSrsId
public long getSrsId()
Get the Spatial Reference System id- Returns:
- srs id
- Since:
- 4.0.0
-
getMinZoom
public long getMinZoom()
Get the min zoom- Returns:
- min zoom
-
getMaxZoom
public long getMaxZoom()
Get the max zoom- Returns:
- max zoom
-
queryForTile
public TileRow queryForTile(long column, long row, long zoomLevel)
Query for a Tile- Parameters:
column
- columnrow
- rowzoomLevel
- zoom level- Returns:
- tile row
-
queryForTile
public TileResultSet queryForTile(long zoomLevel)
Query for Tiles at a zoom level- Parameters:
zoomLevel
- zoom level- Returns:
- tile result set, should be closed
-
queryForTileDescending
public TileResultSet queryForTileDescending(long zoomLevel)
Query for Tiles at a zoom level in descending row and column order- Parameters:
zoomLevel
- zoom level- Returns:
- tile result set, should be closed
-
queryForTilesInColumn
public TileResultSet queryForTilesInColumn(long column, long zoomLevel)
Query for Tiles at a zoom level and column- Parameters:
column
- columnzoomLevel
- zoom level- Returns:
- tile result set
-
queryForTilesInRow
public TileResultSet queryForTilesInRow(long row, long zoomLevel)
Query for Tiles at a zoom level and row- Parameters:
row
- rowzoomLevel
- zoom level- Returns:
- tile result set
-
getZoomLevel
public Long getZoomLevel(double length)
Get the zoom level for the provided width and height in the default units- Parameters:
length
- in default units- Returns:
- zoom level
-
getZoomLevel
public Long getZoomLevel(double width, double height)
Get the zoom level for the provided width and height in the default units- Parameters:
width
- in default unitsheight
- in default units- Returns:
- zoom level
- Since:
- 1.2.1
-
getClosestZoomLevel
public Long getClosestZoomLevel(double length)
Get the closest zoom level for the provided width and height in the default units- Parameters:
length
- in default units- Returns:
- zoom level
- Since:
- 1.2.1
-
getClosestZoomLevel
public Long getClosestZoomLevel(double width, double height)
Get the closest zoom level for the provided width and height in the default units- Parameters:
width
- in default unitsheight
- in default units- Returns:
- zoom level
- Since:
- 1.2.1
-
getApproximateZoomLevel
public Long getApproximateZoomLevel(double length)
Get the approximate zoom level for the provided length in the default units. Tiles may or may not exist for the returned zoom level. The approximate zoom level is determined using a factor of 2 from the zoom levels with tiles.- Parameters:
length
- length in default units- Returns:
- approximate zoom level
- Since:
- 2.0.2
-
getApproximateZoomLevel
public Long getApproximateZoomLevel(double width, double height)
Get the approximate zoom level for the provided width and height in the default units. Tiles may or may not exist for the returned zoom level. The approximate zoom level is determined using a factor of 2 from the zoom levels with tiles.- Parameters:
width
- width in default unitsheight
- height in default units- Returns:
- approximate zoom level
- Since:
- 2.0.2
-
getMaxLength
public double getMaxLength()
Get the max length in default units that contains tiles- Returns:
- max distance length with tiles
- Since:
- 1.2.0
-
getMinLength
public double getMinLength()
Get the min length in default units that contains tiles- Returns:
- min distance length with tiles
- Since:
- 1.2.0
-
queryByTileGrid
public TileResultSet queryByTileGrid(TileGrid tileGrid, long zoomLevel)
Query by tile grid and zoom level- Parameters:
tileGrid
- tile gridzoomLevel
- zoom level- Returns:
- result set from query or null if the zoom level tile ranges do not overlap the bounding box
-
queryByTileGrid
public TileResultSet queryByTileGrid(TileGrid tileGrid, long zoomLevel, String orderBy)
Query by tile grid and zoom level- Parameters:
tileGrid
- tile gridzoomLevel
- zoom levelorderBy
- order by- Returns:
- result set from query or null if the zoom level tile ranges do not overlap the bounding box
- Since:
- 1.2.1
-
queryForTileGrid
public TileGrid queryForTileGrid(long zoomLevel)
Query for the bounding- Parameters:
zoomLevel
- zoom level- Returns:
- tile grid of tiles at the zoom level
- Since:
- 1.1.1
-
deleteTile
public int deleteTile(long column, long row, long zoomLevel)
Delete a Tile- Parameters:
column
- columnrow
- rowzoomLevel
- zoom level- Returns:
- number deleted, should be 0 or 1
-
count
public int count(long zoomLevel)
Count of Tiles at a zoom level- Parameters:
zoomLevel
- zoom level- Returns:
- count
-
isXYZTiles
public boolean isXYZTiles()
Determine if the tiles are in the XYZ tile coordinate format- Returns:
- true if XYZ tile format
- Since:
- 3.5.0
-
getMapZoomRange
public long[] getMapZoomRange()
Get the map zoom level range- Returns:
- map zoom level range, min at index 0, max at index 1
- Since:
- 5.0.0
-
getMapMinZoom
public long getMapMinZoom()
Get the map min zoom level- Returns:
- map min zoom level
- Since:
- 5.0.0
-
getMapMaxZoom
public long getMapMaxZoom()
Get the map max zoom level- Returns:
- map max zoom level
- Since:
- 5.0.0
-
getMapZoom
public long getMapZoom(TileMatrix tileMatrix)
Get the map zoom level from the tile matrix- Parameters:
tileMatrix
- tile matrix- Returns:
- map zoom level
- Since:
- 5.0.0
-
getMapZoom
public long getMapZoom(long zoomLevel)
Get the map zoom level from the tile matrix zoom level- Parameters:
zoomLevel
- tile matrix zoom level- Returns:
- map zoom level
- Since:
- 5.0.0
-
getTileMatrixSetDao
public TileMatrixSetDao getTileMatrixSetDao()
Get a tile matrix set DAO- Returns:
- tile matrix set DAO
- Since:
- 5.0.0
-
getTileMatrixDao
public TileMatrixDao getTileMatrixDao()
Get a tile matrix DAO- Returns:
- tile matrix DAO
- Since:
- 5.0.0
-
-