Package mil.nga.geopackage.tiles
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- Since:
- 1.1.2
- Author:
- osbornb
-
-
Field Summary
-
Fields inherited from class mil.nga.geopackage.tiles.TileGenerator
boundingBox, projection
-
-
Constructor Summary
Constructors Constructor Description UrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, int[] zoomLevels, BoundingBox boundingBox, Projection projection)ConstructorUrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, int minZoom, int maxZoom, BoundingBox boundingBox, Projection projection)ConstructorUrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, int zoomLevel, BoundingBox boundingBox, Projection projection)ConstructorUrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, Collection<Integer> zoomLevels, BoundingBox boundingBox, Projection projection)ConstructorUrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, BoundingBox boundingBox, Projection projection)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHTTPHeaderValue(String field, String value)Add a HTTP Header field value, appending to any existing values for the fieldvoidaddHTTPHeaderValues(String field, List<String> values)Add HTTP Header field values, appending to any existing values for the fieldprotected byte[]createTile(int z, long x, long y)Create the tileintgetDownloadAttempts()Get the number of download attempts per tileMap<String,List<String>>getHttpHeader()Get the HTTP Header fields and field valuesList<String>getHttpHeaderValues(String field)Get the HTTP Header field valuesStringgetHttpMethod()Get the HTTP request method, when null default is "GET"TileFormatTypegetTileFormat()Get the tile formatprotected voidpreTileGeneration()Called after set up and right before tile generation starts for the first zoom levelvoidsetDownloadAttempts(int downloadAttempts)Set the number of download attempts per tilevoidsetHttpMethod(String httpMethod)Set the HTTP request methodvoidsetTileFormat(TileFormatType tileFormat)Set the tile format-
Methods inherited from class mil.nga.geopackage.tiles.TileGenerator
addZoomLevel, addZoomLevels, addZoomLevels, addZoomLevels, close, generateTiles, getBoundingBox, getBoundingBox, getCompressFormat, getCompressQuality, getGeoPackage, getMaxZoom, getMinZoom, getProgress, getScaling, getTableName, getTileCount, getZoomLevels, isSkipExisting, isXYZTiles, setCompressFormat, setCompressQuality, setProgress, setScaling, setSkipExisting, setXYZTiles
-
-
-
-
Constructor Detail
-
UrlTileGenerator
public UrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, BoundingBox boundingBox, Projection projection)
Constructor- Parameters:
geoPackage- GeoPackagetableName- table nametileUrl- tile URLboundingBox- tiles bounding boxprojection- tiles projection- Since:
- 6.2.0
-
UrlTileGenerator
public UrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, int zoomLevel, BoundingBox boundingBox, Projection projection)
Constructor- Parameters:
geoPackage- GeoPackagetableName- table nametileUrl- tile URLzoomLevel- zoom levelboundingBox- tiles bounding boxprojection- tiles projection- Since:
- 6.2.0
-
UrlTileGenerator
public UrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, int minZoom, int maxZoom, BoundingBox boundingBox, Projection projection)
Constructor- Parameters:
geoPackage- GeoPackagetableName- table nametileUrl- tile URLminZoom- min zoommaxZoom- max zoomboundingBox- tiles bounding boxprojection- tiles projection- Since:
- 1.2.0
-
UrlTileGenerator
public UrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, Collection<Integer> zoomLevels, BoundingBox boundingBox, Projection projection)
Constructor- Parameters:
geoPackage- GeoPackagetableName- table nametileUrl- tile URLzoomLevels- zoom levelsboundingBox- tiles bounding boxprojection- tiles projection- Since:
- 6.2.0
-
UrlTileGenerator
public UrlTileGenerator(GeoPackage geoPackage, String tableName, String tileUrl, int[] zoomLevels, BoundingBox boundingBox, Projection projection)
Constructor- Parameters:
geoPackage- GeoPackagetableName- table nametileUrl- tile URLzoomLevels- zoom levelsboundingBox- tiles bounding boxprojection- tiles projection- Since:
- 6.2.0
-
-
Method Detail
-
getTileFormat
public TileFormatType getTileFormat()
Get the tile format- Returns:
- tile format
-
setTileFormat
public void setTileFormat(TileFormatType tileFormat)
Set the tile format- Parameters:
tileFormat- tile format
-
getDownloadAttempts
public int getDownloadAttempts()
Get the number of download attempts per tile- Returns:
- download attempts
-
setDownloadAttempts
public void setDownloadAttempts(int downloadAttempts)
Set the number of download attempts per tile- Parameters:
downloadAttempts- download attempts per tile
-
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 namevalue- 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 namevalues- field values
-
preTileGeneration
protected void preTileGeneration()
Called after set up and right before tile generation starts for the first zoom level- Specified by:
preTileGenerationin classTileGenerator
-
createTile
protected byte[] createTile(int z, long x, long y)Create the tile- Specified by:
createTilein classTileGenerator- Parameters:
z- zoom levelx- x coordinatey- y coordinate- Returns:
- tile bytes
-
-