Class TileReprojectionCore
- java.lang.Object
-
- mil.nga.geopackage.tiles.reproject.TileReprojectionCore
-
public abstract class TileReprojectionCore extends Object
Tile Reprojection for reprojecting an existing tile table- Since:
- 5.0.0
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected GeoPackageCore
geoPackage
GeoPackageprotected TileReprojectionOptimize
optimize
Optional optimizationprotected TileGrid
optimizeTileGrid
Optimization tile gridprotected long
optimizeZoom
Optimization zoomprotected boolean
overwrite
Overwrite existing tiles at a zoom level when geographic calculations differprotected GeoPackageProgress
progress
Progress callbacksprotected Projection
projection
Projectionprotected boolean
replace
Replace flagprotected UserCoreDao<TileColumn,TileTable,?,?>
reprojectTileDao
Tile DAOprotected String
table
Table nameprotected UserCoreDao<TileColumn,TileTable,?,?>
tileDao
Tile DAOprotected Long
tileHeight
Tile height in pixelsprotected Long
tileWidth
Tile width in pixelsprotected Map<Long,TileReprojectionZoom>
zoomConfigs
Zoom level configuration map
-
Constructor Summary
Constructors Modifier Constructor Description protected
TileReprojectionCore(UserCoreDao<TileColumn,TileTable,?,?> tileDao, GeoPackageCore geoPackage, String table, Projection projection)
Constructorprotected
TileReprojectionCore(UserCoreDao<TileColumn,TileTable,?,?> tileDao, GeoPackageCore geoPackage, UserCoreDao<TileColumn,TileTable,?,?> reprojectTileDao)
Constructorprotected
TileReprojectionCore(UserCoreDao<TileColumn,TileTable,?,?> tileDao, UserCoreDao<TileColumn,TileTable,?,?> reprojectTileDao)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract UserCoreDao<TileColumn,TileTable,?,?>
createReprojectTileDao(String table)
Create the reprojection tile DAOprotected abstract void
createTileMatrix(TileMatrix tileMatrix)
Create the tile matrixprotected abstract void
deleteTileMatrices(boolean reproject, String table)
Delete the table tile matricesprotected void
finish()
Finish the reprojectionTileReprojectionZoom
getConfig(long zoom)
Get the zoom level configuration for a zoom levelTileReprojectionZoom
getConfigOrCreate(long zoom)
Get the zoom level configuration or create new configuration for a zoom levelprotected abstract long
getMapZoom(boolean reproject, TileMatrix tileMatrix)
Get the map zoom of the tile matrixLong
getMatrixHeight(long zoom)
Get a reprojected matrix height from a zoom levelLong
getMatrixWidth(long zoom)
Get a reprojected matrix width from a zoom levelTileReprojectionOptimize
getOptimize()
Get the optimizationprotected abstract long
getOptimizeZoom()
Get the optimization minimum zoom levelGeoPackageProgress
getProgress()
Get the progress callbacksLong
getTileHeight()
Get the tile heightLong
getTileHeight(long zoom)
Get a reprojected tile height from a zoom levelprotected abstract List<TileMatrix>
getTileMatrices(boolean reproject)
Get the tile matricesprotected abstract TileMatrix
getTileMatrix(boolean reproject, long zoom)
Get the tile matrixprotected abstract TileMatrixSet
getTileMatrixSet(boolean reproject)
Get the tile matrix setLong
getTileWidth()
Get the tile widthLong
getTileWidth(long zoom)
Get a reprojected tile width from a zoom levellong
getToZoom(long zoom)
Get a reprojected to zoom level from a zoom level, defaults as the zoom level if not setMap<Long,TileReprojectionZoom>
getZoomConfigs()
Get the zoom level configurationsprotected void
initialize()
Initialize the reprojectionprotected boolean
isActive()
Check if currently activeboolean
isOverwrite()
Is overwrite enabledprotected BoundingBox
optimize(BoundingBox boundingBox)
Optimize the bounding boxint
reproject()
Reproject the tile tableint
reproject(long zoom)
Reproject the tile table for the zoom levelint
reproject(long minZoom, long maxZoom)
Reproject the tile table within the zoom rangeprotected abstract int
reproject(long zoom, long toZoom, BoundingBox boundingBox, long matrixWidth, long matrixHeight, long tileWidth, long tileHeight)
Reproject the tilesint
reproject(List<Long> zooms)
Reproject the tile table for the zoom levels, ordered numerically lowest to highestvoid
setConfig(TileReprojectionZoom config)
Set a zoom level configuration for a zoom levelvoid
setMatrixHeight(long zoom, long matrixHeight)
Set a reprojected matrix height for a zoom levelvoid
setMatrixWidth(long zoom, long matrixWidth)
Set a reprojected matrix width for a zoom levelvoid
setOptimize(TileReprojectionOptimize optimize)
Set the optimizationvoid
setOverwrite(boolean overwrite)
Set the overwrite flagvoid
setProgress(GeoPackageProgress progress)
Set the progress callbacksvoid
setTileHeight(long zoom, long tileHeight)
Set a reprojected tile height for a zoom levelvoid
setTileHeight(Long tileHeight)
Set the tile heightvoid
setTileWidth(long zoom, long tileWidth)
Set a reprojected tile width for a zoom levelvoid
setTileWidth(Long tileWidth)
Set the tile widthvoid
setToZoom(long zoom, long toZoom)
Set a reprojected to zoom level for a zoom level
-
-
-
Field Detail
-
optimize
protected TileReprojectionOptimize optimize
Optional optimization
-
overwrite
protected boolean overwrite
Overwrite existing tiles at a zoom level when geographic calculations differ
-
tileWidth
protected Long tileWidth
Tile width in pixels
-
tileHeight
protected Long tileHeight
Tile height in pixels
-
progress
protected GeoPackageProgress progress
Progress callbacks
-
tileDao
protected UserCoreDao<TileColumn,TileTable,?,?> tileDao
Tile DAO
-
geoPackage
protected GeoPackageCore geoPackage
GeoPackage
-
table
protected String table
Table name
-
projection
protected Projection projection
Projection
-
reprojectTileDao
protected UserCoreDao<TileColumn,TileTable,?,?> reprojectTileDao
Tile DAO
-
replace
protected boolean replace
Replace flag
-
zoomConfigs
protected Map<Long,TileReprojectionZoom> zoomConfigs
Zoom level configuration map
-
optimizeTileGrid
protected TileGrid optimizeTileGrid
Optimization tile grid
-
optimizeZoom
protected long optimizeZoom
Optimization zoom
-
-
Constructor Detail
-
TileReprojectionCore
protected TileReprojectionCore(UserCoreDao<TileColumn,TileTable,?,?> tileDao, GeoPackageCore geoPackage, String table, Projection projection)
Constructor- Parameters:
tileDao
- tile DAOgeoPackage
- GeoPackagetable
- table nameprojection
- projection
-
TileReprojectionCore
protected TileReprojectionCore(UserCoreDao<TileColumn,TileTable,?,?> tileDao, UserCoreDao<TileColumn,TileTable,?,?> reprojectTileDao)
Constructor- Parameters:
tileDao
- tile DAOreprojectTileDao
- reprojection tile DAO
-
TileReprojectionCore
protected TileReprojectionCore(UserCoreDao<TileColumn,TileTable,?,?> tileDao, GeoPackageCore geoPackage, UserCoreDao<TileColumn,TileTable,?,?> reprojectTileDao)
Constructor- Parameters:
tileDao
- tile DAOgeoPackage
- GeoPackagereprojectTileDao
- reprojection tile DAO
-
-
Method Detail
-
getOptimizeZoom
protected abstract long getOptimizeZoom()
Get the optimization minimum zoom level- Returns:
- zoom level
-
createReprojectTileDao
protected abstract UserCoreDao<TileColumn,TileTable,?,?> createReprojectTileDao(String table)
Create the reprojection tile DAO- Parameters:
table
- table name- Returns:
- reprojection tile DAO
-
getTileMatrixSet
protected abstract TileMatrixSet getTileMatrixSet(boolean reproject)
Get the tile matrix set- Parameters:
reproject
- true for reprojection tile dao- Returns:
- tile matrix set
-
getTileMatrices
protected abstract List<TileMatrix> getTileMatrices(boolean reproject)
Get the tile matrices- Parameters:
reproject
- true for reprojection tile dao- Returns:
- tile matrix matrices
-
getTileMatrix
protected abstract TileMatrix getTileMatrix(boolean reproject, long zoom)
Get the tile matrix- Parameters:
reproject
- true for reprojection tile daozoom
- zoom level- Returns:
- tile matrix
-
deleteTileMatrices
protected abstract void deleteTileMatrices(boolean reproject, String table)
Delete the table tile matrices- Parameters:
reproject
- true for reprojection tile daotable
- table name
-
getMapZoom
protected abstract long getMapZoom(boolean reproject, TileMatrix tileMatrix)
Get the map zoom of the tile matrix- Parameters:
reproject
- true for reprojection tile daotileMatrix
- tile matrix- Returns:
- map zoom level
-
createTileMatrix
protected abstract void createTileMatrix(TileMatrix tileMatrix)
Create the tile matrix- Parameters:
tileMatrix
- tile matrix
-
reproject
protected abstract int reproject(long zoom, long toZoom, BoundingBox boundingBox, long matrixWidth, long matrixHeight, long tileWidth, long tileHeight)
Reproject the tiles- Parameters:
zoom
- zoom leveltoZoom
- reprojection zoom levelboundingBox
- bounding boxmatrixWidth
- matrix widthmatrixHeight
- matrix heighttileWidth
- tile widthtileHeight
- tile height- Returns:
- reprojected tiles
-
getOptimize
public TileReprojectionOptimize getOptimize()
Get the optimization- Returns:
- optimization
-
setOptimize
public void setOptimize(TileReprojectionOptimize optimize)
Set the optimization- Parameters:
optimize
- optimization
-
isOverwrite
public boolean isOverwrite()
Is overwrite enabled- Returns:
- overwrite flag
-
setOverwrite
public void setOverwrite(boolean overwrite)
Set the overwrite flag- Parameters:
overwrite
- overwrite flag
-
getTileWidth
public Long getTileWidth()
Get the tile width- Returns:
- tile width
-
setTileWidth
public void setTileWidth(Long tileWidth)
Set the tile width- Parameters:
tileWidth
- tile width
-
getTileHeight
public Long getTileHeight()
Get the tile height- Returns:
- tile height
-
setTileHeight
public void setTileHeight(Long tileHeight)
Set the tile height- Parameters:
tileHeight
- tile height
-
getProgress
public GeoPackageProgress getProgress()
Get the progress callbacks- Returns:
- progress
-
setProgress
public void setProgress(GeoPackageProgress progress)
Set the progress callbacks- Parameters:
progress
- progress callbacks
-
getZoomConfigs
public Map<Long,TileReprojectionZoom> getZoomConfigs()
Get the zoom level configurations- Returns:
- zoom configs
-
getConfig
public TileReprojectionZoom getConfig(long zoom)
Get the zoom level configuration for a zoom level- Parameters:
zoom
- from zoom level- Returns:
- zoom config
-
getConfigOrCreate
public TileReprojectionZoom getConfigOrCreate(long zoom)
Get the zoom level configuration or create new configuration for a zoom level- Parameters:
zoom
- from zoom level- Returns:
- zoom config
-
setConfig
public void setConfig(TileReprojectionZoom config)
Set a zoom level configuration for a zoom level- Parameters:
config
- zoom configuration
-
setToZoom
public void setToZoom(long zoom, long toZoom)
Set a reprojected to zoom level for a zoom level- Parameters:
zoom
- zoom leveltoZoom
- reprojected zoom level
-
getToZoom
public long getToZoom(long zoom)
Get a reprojected to zoom level from a zoom level, defaults as the zoom level if not set- Parameters:
zoom
- zoom level- Returns:
- reprojected to zoom level
-
setTileWidth
public void setTileWidth(long zoom, long tileWidth)
Set a reprojected tile width for a zoom level- Parameters:
tileWidth
- reprojected tile widthzoom
- zoom level
-
getTileWidth
public Long getTileWidth(long zoom)
Get a reprojected tile width from a zoom level- Parameters:
zoom
- zoom level- Returns:
- reprojected tile width
-
setTileHeight
public void setTileHeight(long zoom, long tileHeight)
Set a reprojected tile height for a zoom level- Parameters:
zoom
- zoom leveltileHeight
- reprojected tile height
-
getTileHeight
public Long getTileHeight(long zoom)
Get a reprojected tile height from a zoom level- Parameters:
zoom
- zoom level- Returns:
- reprojected tile height
-
setMatrixWidth
public void setMatrixWidth(long zoom, long matrixWidth)
Set a reprojected matrix width for a zoom level- Parameters:
matrixWidth
- reprojected matrix widthzoom
- zoom level
-
getMatrixWidth
public Long getMatrixWidth(long zoom)
Get a reprojected matrix width from a zoom level- Parameters:
zoom
- zoom level- Returns:
- reprojected matrix width
-
setMatrixHeight
public void setMatrixHeight(long zoom, long matrixHeight)
Set a reprojected matrix height for a zoom level- Parameters:
matrixHeight
- reprojected matrix heightzoom
- zoom level
-
getMatrixHeight
public Long getMatrixHeight(long zoom)
Get a reprojected matrix height from a zoom level- Parameters:
zoom
- zoom level- Returns:
- reprojected matrix height
-
initialize
protected void initialize()
Initialize the reprojection
-
finish
protected void finish()
Finish the reprojection
-
reproject
public int reproject()
Reproject the tile table- Returns:
- created tiles
-
reproject
public int reproject(long minZoom, long maxZoom)
Reproject the tile table within the zoom range- Parameters:
minZoom
- min zoommaxZoom
- max zoom- Returns:
- created tiles
-
reproject
public int reproject(List<Long> zooms)
Reproject the tile table for the zoom levels, ordered numerically lowest to highest- Parameters:
zooms
- zoom levels, ordered lowest to highest- Returns:
- created tiles
-
reproject
public int reproject(long zoom)
Reproject the tile table for the zoom level- Parameters:
zoom
- zoom level- Returns:
- created tiles
-
optimize
protected BoundingBox optimize(BoundingBox boundingBox)
Optimize the bounding box- Parameters:
boundingBox
- bounding box- Returns:
- optimized bounding box
-
isActive
protected boolean isActive()
Check if currently active- Returns:
- true if active
-
-