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,TileCursor>
mil.nga.geopackage.tiles.user.TileDao
Tile DAO for reading tile user tables
-
Field Summary
Fields inherited from class mil.nga.geopackage.user.UserCoreDao
projection
-
Constructor Summary
ConstructorDescriptionTileDao
(String database, GeoPackageConnection db, TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices, TileTable table) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 TilegetApproximateZoomLevel
(double length) Get the approximate zoom level for the provided length in the default units.getApproximateZoomLevel
(double width, double height) Get the approximate zoom level for the provided width and height in the default units.getBoundingBox
(long zoomLevel) Get the bounding box of tilesgetBoundingBox
(long zoomLevel, Projection projection) Get the bounding box of tiles at the zoom levelgetBoundingBox
(Projection projection) getClosestZoomLevel
(double length) Get the closest zoom level for the provided width and height in the default unitsgetClosestZoomLevel
(double width, double height) Get the closest zoom level for the provided width and height in the default unitslong
Get the map max zoom levellong
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[]
Get the map zoom level rangedouble
Get the max length in default units that contains tileslong
Get the max zoomdouble
Get the min length in default units that contains tileslong
Get the min zoomgetSrs()
Get the Spatial Reference Systemlong
getSrsId()
Get the Spatial Reference System idGet the Tile connectiongetTileGrid
(long zoomLevel) Get the tile grid of the zoom levelGet the tile matricesgetTileMatrix
(long zoomLevel) Get the tile matrix at the zoom levelGet the tile matrix at the min (first) zoomGet a tile matrix DAOGet the tile matrix setGet a tile matrix set DAOgetZoomLevel
(double length) Get the zoom level for the provided width and height in the default unitsgetZoomLevel
(double width, double height) Get the zoom level for the provided width and height in the default unitsGet the zoom levelsboolean
Determine if the tiles are in the XYZ tile coordinate formatnewRow()
queryByTileGrid
(TileGrid tileGrid, long zoomLevel) Query by tile grid and zoom levelqueryByTileGrid
(TileGrid tileGrid, long zoomLevel, String orderBy) Query by tile grid and zoom levelqueryForTile
(long zoomLevel) Query for Tiles at a zoom levelqueryForTile
(long column, long row, long zoomLevel) Query for a TilequeryForTileDescending
(long zoomLevel) Query for Tiles at a zoom level in descending row and column orderqueryForTileGrid
(long zoomLevel) Query for the boundingqueryForTilesInColumn
(long column, long zoomLevel) Query for Tiles at a zoom level and columnqueryForTilesInRow
(long row, long zoomLevel) Query for Tiles at a zoom level and rowMethods inherited from class mil.nga.geopackage.user.UserDao
beginTransaction, commit, endTransaction, getDatabaseConnection, getDb, insert, insert, insertOrThrow, inTransaction, isInvalidRequery, prepareResult, query, query, queryForIdRow, renameTableColumn, setInvalidRequery, setUseBindings, 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, 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, setPkModifiable, setValueValidation
-
Constructor Details
-
TileDao
public TileDao(String database, GeoPackageConnection db, TileMatrixSet tileMatrixSet, List<TileMatrix> tileMatrices, TileTable table) Constructor- Parameters:
database
- database namedb
- GeoPackage connectiontileMatrixSet
- tile matrix settileMatrices
- tile matricestable
- tile table
-
-
Method Details
-
getBoundingBox
- Specified by:
getBoundingBox
in classUserCoreDao<TileColumn,
TileTable, TileRow, TileCursor>
-
getBoundingBox
- Specified by:
getBoundingBox
in classUserCoreDao<TileColumn,
TileTable, TileRow, TileCursor>
-
getBoundingBox
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
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
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
- Specified by:
newRow
in classUserCoreDao<TileColumn,
TileTable, TileRow, TileCursor>
-
getTileDb
Get the Tile connection- Returns:
- tile connection
-
getTileMatrixSet
Get the tile matrix set- Returns:
- tile matrix set
-
getTileMatrices
Get the tile matrices- Returns:
- tile matrices
-
getZoomLevels
Get the zoom levels- Returns:
- zoom level set
- Since:
- 5.0.0
-
getTileMatrix
Get the tile matrix at the zoom level- Parameters:
zoomLevel
- zoom level- Returns:
- tile matrix
-
getTileMatrixAtMinZoom
Get the tile matrix at the min (first) zoom- Returns:
- tile matrix
- Since:
- 5.0.0
-
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
Query for a Tile- Parameters:
column
- columnrow
- rowzoomLevel
- zoom level- Returns:
- tile row
-
queryForTile
Query for Tiles at a zoom level- Parameters:
zoomLevel
- zoom level- Returns:
- tile cursor, should be closed
-
queryForTileDescending
Query for Tiles at a zoom level in descending row and column order- Parameters:
zoomLevel
- zoom level- Returns:
- tile cursor, should be closed
-
queryForTilesInColumn
Query for Tiles at a zoom level and column- Parameters:
column
- columnzoomLevel
- zoom level- Returns:
- tile cursor
-
queryForTilesInRow
Query for Tiles at a zoom level and row- Parameters:
row
- rowzoomLevel
- zoom level- Returns:
- tile cursor
-
getZoomLevel
Get the zoom level for the provided width and height in the default units- Parameters:
length
- in default units- Returns:
- zoom level
-
getZoomLevel
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.3.1
-
getClosestZoomLevel
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.3.1
-
getClosestZoomLevel
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.3.1
-
getApproximateZoomLevel
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
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
-
queryByTileGrid
Query by tile grid and zoom level- Parameters:
tileGrid
- tile gridzoomLevel
- zoom level- Returns:
- cursor from query or null if the zoom level tile ranges do not overlap the bounding box
-
queryByTileGrid
Query by tile grid and zoom level- Parameters:
tileGrid
- tile gridzoomLevel
- zoom levelorderBy
- order by- Returns:
- cursor from query or null if the zoom level tile ranges do not overlap the bounding box
- Since:
- 1.3.1
-
queryForTileGrid
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
-
getMaxLength
public double getMaxLength()Get the max length in default units that contains tiles- Returns:
- max distance length with tiles
- Since:
- 1.3.0
-
getMinLength
public double getMinLength()Get the min length in default units that contains tiles- Returns:
- min distance length with tiles
- Since:
- 1.3.0
-
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
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
Get a tile matrix set DAO- Returns:
- tile matrix set DAO
- Since:
- 5.0.0
-
getTileMatrixDao
Get a tile matrix DAO- Returns:
- tile matrix DAO
- Since:
- 5.0.0
-