Class FeatureTileGenerator


  • public class FeatureTileGenerator
    extends TileGenerator
    Creates a set of tiles within a GeoPackage by generating tiles from features
    • Constructor Detail

      • FeatureTileGenerator

        public FeatureTileGenerator​(Context context,
                                    GeoPackage geoPackage,
                                    String tableName,
                                    FeatureTiles featureTiles,
                                    int minZoom,
                                    int maxZoom,
                                    BoundingBox boundingBox,
                                    Projection projection)
        Constructor
        Parameters:
        context - app context
        geoPackage - GeoPackage
        tableName - table name
        featureTiles - feature tiles
        minZoom - min zoom
        maxZoom - max zoom
        boundingBox - tiles bounding box
        projection - tiles projection
        Since:
        1.3.0
      • FeatureTileGenerator

        public FeatureTileGenerator​(Context context,
                                    GeoPackage geoPackage,
                                    String tableName,
                                    FeatureTiles featureTiles,
                                    GeoPackage featureGeoPackage,
                                    int minZoom,
                                    int maxZoom,
                                    BoundingBox boundingBox,
                                    Projection projection)
        Constructor
        Parameters:
        context - app context
        geoPackage - GeoPackage
        tableName - table name
        featureTiles - feature tiles
        featureGeoPackage - feature GeoPackage if different from the destination
        minZoom - min zoom
        maxZoom - max zoom
        boundingBox - tiles bounding box
        projection - tiles projection
        Since:
        3.2.0
      • FeatureTileGenerator

        public FeatureTileGenerator​(Context context,
                                    GeoPackage geoPackage,
                                    String tableName,
                                    FeatureTiles featureTiles,
                                    int minZoom,
                                    int maxZoom,
                                    Projection projection)
        Constructor, find the the bounding box from the feature table
        Parameters:
        context - app context
        geoPackage - GeoPackage
        tableName - table name
        featureTiles - feature tiles
        minZoom - min zoom
        maxZoom - max zoom
        projection - tiles projection
        Since:
        3.2.0
      • FeatureTileGenerator

        public FeatureTileGenerator​(Context context,
                                    GeoPackage geoPackage,
                                    String tableName,
                                    FeatureTiles featureTiles,
                                    GeoPackage featureGeoPackage,
                                    int minZoom,
                                    int maxZoom,
                                    Projection projection)
        Constructor, find the the bounding box from the feature table
        Parameters:
        context - app context
        geoPackage - GeoPackage
        tableName - table name
        featureTiles - feature tiles
        featureGeoPackage - feature GeoPackage if different from the destination
        minZoom - min zoom
        maxZoom - max zoom
        projection - tiles projection
        Since:
        3.2.0
    • Method Detail

      • getBoundingBox

        public BoundingBox getBoundingBox​(int zoom)
        Get the bounding box, possibly expanded for the zoom level
        Overrides:
        getBoundingBox in class TileGenerator
        Parameters:
        zoom - zoom level
        Returns:
        original or expanded bounding box
      • close

        public void close()
        Close the GeoPackage
        Overrides:
        close in class TileGenerator
      • isLinkTables

        public boolean isLinkTables()
        Is the feature table going to be linked with the tile table? Defaults to true.
        Returns:
        true if tables will be linked upon generation
        Since:
        1.2.5
      • setLinkTables

        public void setLinkTables​(boolean linkTables)
        Set the link tables flag
        Parameters:
        linkTables - link tables flag
        Since:
        1.2.5
      • preTileGeneration

        protected void preTileGeneration()
        Called after set up and right before tile generation starts for the first zoom level
        Specified by:
        preTileGeneration in class TileGenerator
      • createTile

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