Class TileGenerator

    • Field Detail

      • projection

        protected Projection projection
        Tiles projection
      • boundingBox

        protected BoundingBox boundingBox
        Tile bounding box
    • Constructor Detail

      • TileGenerator

        public TileGenerator​(GeoPackage geoPackage,
                             String tableName,
                             BoundingBox boundingBox,
                             Projection projection)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tableName - table name
        boundingBox - tiles bounding box
        projection - tiles projection
        Since:
        6.2.0
      • TileGenerator

        public TileGenerator​(GeoPackage geoPackage,
                             String tableName,
                             int zoomLevel,
                             BoundingBox boundingBox,
                             Projection projection)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tableName - table name
        zoomLevel - zoom level
        boundingBox - tiles bounding box
        projection - tiles projection
        Since:
        6.2.0
      • TileGenerator

        public TileGenerator​(GeoPackage geoPackage,
                             String tableName,
                             int minZoom,
                             int maxZoom,
                             BoundingBox boundingBox,
                             Projection projection)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tableName - table name
        minZoom - min zoom
        maxZoom - max zoom
        boundingBox - tiles bounding box
        projection - tiles projection
        Since:
        1.2.0
      • TileGenerator

        public TileGenerator​(GeoPackage geoPackage,
                             String tableName,
                             Collection<Integer> zoomLevels,
                             BoundingBox boundingBox,
                             Projection projection)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tableName - table name
        zoomLevels - zoom levels
        boundingBox - tiles bounding box
        projection - tiles projection
        Since:
        6.2.0
      • TileGenerator

        public TileGenerator​(GeoPackage geoPackage,
                             String tableName,
                             int[] zoomLevels,
                             BoundingBox boundingBox,
                             Projection projection)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tableName - table name
        zoomLevels - zoom levels
        boundingBox - tiles bounding box
        projection - tiles projection
        Since:
        6.2.0
    • Method Detail

      • getGeoPackage

        public GeoPackage getGeoPackage()
        Get the GeoPackage
        Returns:
        GeoPackage
      • getTableName

        public String getTableName()
        Get the table name
        Returns:
        table name
      • getMinZoom

        public int getMinZoom()
        Get the min zoom
        Returns:
        min zoom
      • getMaxZoom

        public int getMaxZoom()
        Get the max zoom
        Returns:
        max zoom
      • getZoomLevels

        public SortedSet<Integer> getZoomLevels()
        Get the zoom levels (read only)
        Returns:
        zoom levels
        Since:
        6.2.0
      • addZoomLevel

        public boolean addZoomLevel​(int zoomLevel)
        Add a zoom level
        Parameters:
        zoomLevel - zoom level
        Returns:
        true if zoom level added
        Since:
        6.2.0
      • addZoomLevels

        public boolean addZoomLevels​(int minZoom,
                                     int maxZoom)
        Add a range of zoom levels
        Parameters:
        minZoom - min zoom level
        maxZoom - max zoom level
        Returns:
        true if at least one zoom level added
        Since:
        6.2.0
      • addZoomLevels

        public boolean addZoomLevels​(Collection<Integer> zoomLevels)
        Add zoom levels
        Parameters:
        zoomLevels - zoom levels
        Returns:
        true if at least one zoom level added
        Since:
        6.2.0
      • addZoomLevels

        public boolean addZoomLevels​(int[] zoomLevels)
        Add zoom levels
        Parameters:
        zoomLevels - zoom levels
        Returns:
        true if at least one zoom level added
        Since:
        6.2.0
      • getBoundingBox

        public BoundingBox getBoundingBox()
        Get bounding box
        Returns:
        bounding box
      • getBoundingBox

        public BoundingBox getBoundingBox​(int zoom)
        Get the bounding box, possibly expanded for the zoom level
        Parameters:
        zoom - zoom level
        Returns:
        original or expanded bounding box
        Since:
        3.2.0
      • setCompressFormat

        public void setCompressFormat​(String compressFormat)
        Set the compress format
        Parameters:
        compressFormat - compression format
      • getCompressFormat

        public String getCompressFormat()
        Get the compress format
        Returns:
        compress format
      • setCompressQuality

        public void setCompressQuality​(Float compressQuality)
        Set the compress quality (0.0 to 1.0). The Compress format must be set for this to be used.
        Parameters:
        compressQuality - compression quality
      • getCompressQuality

        public Float getCompressQuality()
        Get the compress quality
        Returns:
        compress quality or null
      • setProgress

        public void setProgress​(GeoPackageZoomLevelProgress progress)
        Set the progress tracker
        Parameters:
        progress - progress tracker
      • setXYZTiles

        public void setXYZTiles​(boolean xyzTiles)
        Set the XYZ Tiles flag to true to generate XYZ tile format tiles. Default is false
        Parameters:
        xyzTiles - XYZ Tiles flag
        Since:
        3.5.0
      • isXYZTiles

        public boolean isXYZTiles()
        Is the XYZ Tiles flag set to generate XYZ tile format tiles.
        Returns:
        true if XYZ Tiles format, false if GeoPackage
        Since:
        3.5.0
      • getScaling

        public TileScaling getScaling()
        Get the tile scaling settings
        Returns:
        tile scaling
        Since:
        2.0.2
      • setScaling

        public void setScaling​(TileScaling scaling)
        Set the tile scaling settings
        Parameters:
        scaling - tile scaling
        Since:
        2.0.2
      • isSkipExisting

        public boolean isSkipExisting()
        Is skip existing tiles on
        Returns:
        true if skipping existing tiles
        Since:
        3.5.0
      • setSkipExisting

        public void setSkipExisting​(boolean skipExisting)
        Set the skip existing tiles flag
        Parameters:
        skipExisting - true to skip existing tiles
        Since:
        3.5.0
      • getTileCount

        public int getTileCount()
        Get the tile count of tiles to be generated
        Returns:
        tile count
      • close

        public void close()
        Close the GeoPackage
      • preTileGeneration

        protected abstract void preTileGeneration()
        Called after set up and right before tile generation starts for the first zoom level
      • createTile

        protected abstract byte[] createTile​(int z,
                                             long x,
                                             long y)
        Create the tile
        Parameters:
        z - zoom level
        x - x coordinate
        y - y coordinate
        Returns:
        tile bytes