Class DefaultFeatureTiles

java.lang.Object
mil.nga.geopackage.tiles.features.FeatureTiles
mil.nga.geopackage.tiles.features.DefaultFeatureTiles

public class DefaultFeatureTiles extends FeatureTiles
Default Feature Tiles implementation using Android Graphics to draw tiles from Well Known Binary Geometries
Since:
1.3.1
  • Field Details

    • DEFAULT_GEOMETRY_CACHE_SIZE

      public static final int DEFAULT_GEOMETRY_CACHE_SIZE
      Default max number of feature geometries to retain in cache
      Since:
      3.3.0
      See Also:
    • geometryCache

      protected final LruCache<Long,GeoPackageGeometryData> geometryCache
      Geometry cache
    • cacheGeometries

      protected boolean cacheGeometries
      When true, geometries are cached. Default is true
  • Constructor Details

    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, FeatureDao featureDao)
      Constructor
      Parameters:
      context - context
      featureDao - feature dao
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, FeatureDao featureDao, boolean geodesic)
      Constructor
      Parameters:
      context - context
      featureDao - feature dao
      geodesic - draw geometries using geodesic lines
      Since:
      6.7.4
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, FeatureDao featureDao, float density)
      Constructor
      Parameters:
      context - context
      featureDao - feature dao
      density - display density: DisplayMetrics.density
      Since:
      3.2.0
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, FeatureDao featureDao, float density, boolean geodesic)
      Constructor
      Parameters:
      context - context
      featureDao - feature dao
      density - display density: DisplayMetrics.density
      geodesic - draw geometries using geodesic lines
      Since:
      6.7.4
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, FeatureDao featureDao, int width, int height)
      Constructor
      Parameters:
      context - context
      featureDao - feature dao
      width - drawn tile width
      height - drawn tile height
      Since:
      3.2.0
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, FeatureDao featureDao, int width, int height, boolean geodesic)
      Constructor
      Parameters:
      context - context
      featureDao - feature dao
      width - drawn tile width
      height - drawn tile height
      geodesic - draw geometries using geodesic lines
      Since:
      6.7.4
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      Since:
      3.2.0
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, boolean geodesic)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      geodesic - draw geometries using geodesic lines
      Since:
      6.7.4
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      density - display density: DisplayMetrics.density
      Since:
      3.2.0
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density, boolean geodesic)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      density - display density: DisplayMetrics.density
      geodesic - draw geometries using geodesic lines
      Since:
      6.7.4
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, int width, int height)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      width - drawn tile width
      height - drawn tile height
      Since:
      3.2.0
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, int width, int height, boolean geodesic)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      width - drawn tile width
      height - drawn tile height
      geodesic - draw geometries using geodesic lines
      Since:
      6.7.4
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density, int width, int height)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      density - display density: DisplayMetrics.density
      width - drawn tile width
      height - drawn tile height
      Since:
      3.2.0
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density, int width, int height, boolean geodesic)
      Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
      Parameters:
      context - context
      geoPackage - GeoPackage
      featureDao - feature dao
      density - display density: DisplayMetrics.density
      width - drawn tile width
      height - drawn tile height
      geodesic - draw geometries using geodesic lines
      Since:
      6.7.4
    • DefaultFeatureTiles

      public DefaultFeatureTiles(Context context)
      Constructor, only for retrieving default feature attributes
      Parameters:
      context - context
  • Method Details

    • isCacheGeometries

      public boolean isCacheGeometries()
      Is caching geometries enabled?
      Returns:
      true if caching geometries
      Since:
      3.3.0
    • setCacheGeometries

      public void setCacheGeometries(boolean cacheGeometries)
      Set the cache geometries flag
      Parameters:
      cacheGeometries - true to cache geometries
      Since:
      3.3.0
    • clearCache

      public void clearCache()
      Clear all caches
      Overrides:
      clearCache in class FeatureTiles
    • clearGeometryCache

      public void clearGeometryCache()
      Clear the geometry cache
      Since:
      3.3.0
    • setGeometryCacheSize

      public void setGeometryCacheSize(int size)
      Set / resize the geometry cache size
      Parameters:
      size - new size
      Since:
      3.3.0
    • drawTile

      public Bitmap drawTile(int zoom, BoundingBox boundingBox, FeatureIndexResults results)
      Draw a tile bitmap from feature index results
      Specified by:
      drawTile in class FeatureTiles
      Parameters:
      zoom - zoom level
      boundingBox - web mercator bounding box
      results - feature index results
      Returns:
      tile
    • drawTile

      public Bitmap drawTile(int zoom, BoundingBox boundingBox, FeatureCursor cursor)
      Draw a tile bitmap from feature geometries in the provided cursor
      Specified by:
      drawTile in class FeatureTiles
      Parameters:
      zoom - zoom level
      boundingBox - web mercator bounding box
      cursor - feature cursor
      Returns:
      tile
    • drawTile

      public Bitmap drawTile(int zoom, BoundingBox boundingBox, List<FeatureRow> featureRow)
      Draw a tile bitmap from the feature rows
      Specified by:
      drawTile in class FeatureTiles
      Parameters:
      zoom - zoom level
      boundingBox - web mercator bounding box
      featureRow - feature row
      Returns:
      tile