Package org.geotools.tpk
Class TPKFile
- Object
-
- TPKFile
-
public class TPKFile extends Object
-
-
Constructor Summary
Constructors Constructor Description TPKFile(File theFile, Map<Long,TPKZoomLevel> zoomLevelMap)
Constructor -- used for first open of a TPK file, parses the conf.xml file and builds the zoomLevelMapTPKFile(File theFile, Map<Long,TPKZoomLevel> zoomLevelMap, Bounds bounds, String imageFormat)
Constructor -- used for all subsequent opens of the TPK file (ie once the zoomLevelMap has been created)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Called to close the TPK file and release resources being heldBounds
getBounds()
Using the highest zoom level contained in the TPK file use the tile coverage to calculate the geographical bounds of the maplong
getClosestZoom(long zoomLevel)
Find the closest zoom level in the TPK to the given zoom levelString
getImageFormat()
long
getMaxColumn(long zoomLevel)
Find the maximum Web Tile Map Service column number for the given zoom levellong
getMaxRow(long zoomLevel)
Find the maximum Web Tile Map Service row number for the given zoom levellong
getMaxZoomLevel()
long
getMinColumn(long zoomLevel)
Find the minimum Web Tile Map Service column number for the given zoom levellong
getMinRow(long zoomLevel)
Find the minimum Web Tile Map Service row number for the given zoom levellong
getMinZoomLevel()
List<TPKTile>
getTiles(long zoomLevel, long top, long bottom, long left, long right, String format)
Return a list of tile objects, each with its intended location, format and raw data
-
-
-
Constructor Detail
-
TPKFile
public TPKFile(File theFile, Map<Long,TPKZoomLevel> zoomLevelMap)
Constructor -- used for first open of a TPK file, parses the conf.xml file and builds the zoomLevelMap- Parameters:
theFile
- -- the TPK file in questionzoomLevelMap
- -- reference to an empty hashmap object that we will populate
-
TPKFile
public TPKFile(File theFile, Map<Long,TPKZoomLevel> zoomLevelMap, Bounds bounds, String imageFormat)
Constructor -- used for all subsequent opens of the TPK file (ie once the zoomLevelMap has been created)- Parameters:
theFile
- -- the TPK filezoomLevelMap
- -- previously constructed zoomLevelMapbounds
- -- bounds of the mapimageFormat
- -- the image format being used
-
-
Method Detail
-
close
public void close()
Called to close the TPK file and release resources being held
-
getMinZoomLevel
public long getMinZoomLevel()
- Returns:
- -- the minimum Web Tile Service zoom level contained in the TPK
-
getMaxZoomLevel
public long getMaxZoomLevel()
- Returns:
- -- the maximum Web Tile Service zoom level contained in the TPK
-
getImageFormat
public String getImageFormat()
- Returns:
- -- the image format used in the TPK (eg JPEG, PNG)
-
getBounds
public Bounds getBounds()
Using the highest zoom level contained in the TPK file use the tile coverage to calculate the geographical bounds of the map- Returns:
- -- the geographical coverage of the map
-
getClosestZoom
public long getClosestZoom(long zoomLevel)
Find the closest zoom level in the TPK to the given zoom level- Parameters:
zoomLevel
- -- zoom level to match or approximate- Returns:
- -- the given zoom level of the nearest one to it
-
getMinColumn
public long getMinColumn(long zoomLevel)
Find the minimum Web Tile Map Service column number for the given zoom level- Parameters:
zoomLevel
- -- zoom level in question- Returns:
- -- -1 if zoom level not in TPK else minimum column at zoom level
-
getMaxColumn
public long getMaxColumn(long zoomLevel)
Find the maximum Web Tile Map Service column number for the given zoom level- Parameters:
zoomLevel
- -- zoom level in question- Returns:
- -- -1 if zoom level not in TPK else maximum column at zoom level
-
getMinRow
public long getMinRow(long zoomLevel)
Find the minimum Web Tile Map Service row number for the given zoom level- Parameters:
zoomLevel
- -- zoom level in question- Returns:
- -- -1 if zoom level not in TPK else minimum row at zoom level
-
getMaxRow
public long getMaxRow(long zoomLevel)
Find the maximum Web Tile Map Service row number for the given zoom level- Parameters:
zoomLevel
- -- zoom level in question- Returns:
- -- -1 if zoom level not in TPK else maximum row at zoom level
-
getTiles
public List<TPKTile> getTiles(long zoomLevel, long top, long bottom, long left, long right, String format)
Return a list of tile objects, each with its intended location, format and raw data- Parameters:
zoomLevel
- -- zoom level of tiles to returntop
- -- topmost row of tiles (lattitude)bottom
- -- bottommost row of tilesleft
- -- leftmost column of tiles (longitude)right
- -- rightmost column of tilesformat
- -- format to interpret tile data (PNG, JPEG)- Returns:
- -- list of TPKTile objects
-
-