Class UrlTileGenerator

java.lang.Object
mil.nga.geopackage.tiles.TileGenerator
mil.nga.geopackage.tiles.UrlTileGenerator

public class UrlTileGenerator extends TileGenerator
Creates a set of tiles within a GeoPackage by downloading the tiles from a URL
  • Constructor Details

    • UrlTileGenerator

      public UrlTileGenerator(Context context, GeoPackage geoPackage, String tableName, String tileUrl, BoundingBox boundingBox, Projection projection)
      Constructor
      Parameters:
      context - app context
      geoPackage - GeoPackage
      tableName - table name
      tileUrl - tile URL
      boundingBox - tiles bounding box
      projection - tiles projection
      Since:
      6.2.0
    • UrlTileGenerator

      public UrlTileGenerator(Context context, GeoPackage geoPackage, String tableName, String tileUrl, int zoomLevel, BoundingBox boundingBox, Projection projection)
      Constructor
      Parameters:
      context - app context
      geoPackage - GeoPackage
      tableName - table name
      tileUrl - tile URL
      zoomLevel - zoom level
      boundingBox - tiles bounding box
      projection - tiles projection
      Since:
      6.2.0
    • UrlTileGenerator

      public UrlTileGenerator(Context context, GeoPackage geoPackage, String tableName, String tileUrl, int minZoom, int maxZoom, BoundingBox boundingBox, Projection projection)
      Constructor
      Parameters:
      context - app context
      geoPackage - GeoPackage
      tableName - table name
      tileUrl - tile url
      minZoom - min zoom
      maxZoom - max zoom
      boundingBox - tiles bounding box
      projection - tiles projection
      Since:
      1.3.0
    • UrlTileGenerator

      public UrlTileGenerator(Context context, GeoPackage geoPackage, String tableName, String tileUrl, Collection<Integer> zoomLevels, BoundingBox boundingBox, Projection projection)
      Constructor
      Parameters:
      context - app context
      geoPackage - GeoPackage
      tableName - table name
      tileUrl - tile URL
      zoomLevels - zoom levels
      boundingBox - tiles bounding box
      projection - tiles projection
      Since:
      6.2.0
    • UrlTileGenerator

      public UrlTileGenerator(Context context, GeoPackage geoPackage, String tableName, String tileUrl, int[] zoomLevels, BoundingBox boundingBox, Projection projection)
      Constructor
      Parameters:
      context - app context
      geoPackage - GeoPackage
      tableName - table name
      tileUrl - tile URL
      zoomLevels - zoom levels
      boundingBox - tiles bounding box
      projection - tiles projection
      Since:
      6.2.0
  • Method Details

    • isTms

      public boolean isTms()
      Is TMS URL
      Returns:
      true if TMS URL
      Since:
      1.2.1
    • setTms

      public void setTms(boolean tms)
      Set the TMS URL flag
      Parameters:
      tms - true if a TMS URL
      Since:
      1.2.1
    • getHttpMethod

      public String getHttpMethod()
      Get the HTTP request method, when null default is "GET"
      Returns:
      method
    • setHttpMethod

      public void setHttpMethod(String httpMethod)
      Set the HTTP request method
      Parameters:
      httpMethod - method ("GET", "POST")
    • getHttpHeader

      public Map<String,List<String>> getHttpHeader()
      Get the HTTP Header fields and field values
      Returns:
      header map
    • getHttpHeaderValues

      public List<String> getHttpHeaderValues(String field)
      Get the HTTP Header field values
      Parameters:
      field - field name
      Returns:
      field values
    • addHTTPHeaderValue

      public void addHTTPHeaderValue(String field, String value)
      Add a HTTP Header field value, appending to any existing values for the field
      Parameters:
      field - field name
      value - field value
    • addHTTPHeaderValues

      public void addHTTPHeaderValues(String field, List<String> values)
      Add HTTP Header field values, appending to any existing values for the field
      Parameters:
      field - field name
      values - field values
    • 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