Class TileReprojectionCore


  • public abstract class TileReprojectionCore
    extends Object
    Tile Reprojection for reprojecting an existing tile table
    Since:
    5.0.0
    Author:
    osbornb
    • Field Detail

      • 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
      • table

        protected String table
        Table name
      • projection

        protected Projection projection
        Projection
      • replace

        protected boolean replace
        Replace flag
      • optimizeTileGrid

        protected TileGrid optimizeTileGrid
        Optimization tile grid
      • optimizeZoom

        protected long optimizeZoom
        Optimization zoom
    • 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 dao
        zoom - 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 dao
        table - 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 dao
        tileMatrix - 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 level
        toZoom - reprojection zoom level
        boundingBox - bounding box
        matrixWidth - matrix width
        matrixHeight - matrix height
        tileWidth - tile width
        tileHeight - tile height
        Returns:
        reprojected tiles
      • 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
      • 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 level
        toZoom - 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 width
        zoom - 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 level
        tileHeight - 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 width
        zoom - 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 height
        zoom - 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 zoom
        maxZoom - 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