Package org.ka2ddo.yaac.srtm
Class SRTMTile
java.lang.Object
org.ka2ddo.yaac.srtm.SRTMTile
This class defines the in-memory cache entry for one SRTM binary tile (1 arc-second
or 3 arc-second variations).
- Author:
- Andrew Pavlin, KA2DDO
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String[]
Mappings of NASADEM source code byte values to names of data sources as defined here.short
The maximum change in elevation between any two adjacent cells, in meters.short
The highest elevation in this tile, in meters.int
The integer latitude (in whole degrees) of the southwest corner of the tile.int
The integer longitude (in whole degrees) of the southwest corner of the tile.short
The lowest elevation in this tile, in meters.static final short
Reserved value indicating the elevation at the specified grid point is unknown.short
The number of grid cells + 1 in this tile.byte[]
If an associated .num file is provided with the .hgt file, this contains the code numbers identifying all unique sources of the elevation data in this tile.short[][]
The two-dimensional grid of regularly spaced elevation values (separated by 1 degree / (numCellsPerAxis - 1)), The first index is along the latitude axis, with index 0 at the southernmost latitude, and the second index is along the longitude axis, with index 0 at the westernmost longitude. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getSize()
Report the amount of memory consumed by this tile.void
Read a tile file into this in-memory data structurevoid
Read a zipped tile file into this in-memory data structurevoid
setCoord
(SRTMTileId id) Set the lower-left corner coordinates of this tile.toString()
Returns a string representation of the object.
-
Field Details
-
minLat
public int minLatThe integer latitude (in whole degrees) of the southwest corner of the tile. -
minLon
public int minLonThe integer longitude (in whole degrees) of the southwest corner of the tile. -
numCellsPerAxis
public short numCellsPerAxisThe number of grid cells + 1 in this tile. For 3-arc-second tiles, this will be 1201. -
maxGradient
public short maxGradientThe maximum change in elevation between any two adjacent cells, in meters. -
minZ
public short minZThe lowest elevation in this tile, in meters. -
maxZ
public short maxZThe highest elevation in this tile, in meters. -
zCells
public short[][] zCellsThe two-dimensional grid of regularly spaced elevation values (separated by 1 degree / (numCellsPerAxis - 1)), The first index is along the latitude axis, with index 0 at the southernmost latitude, and the second index is along the longitude axis, with index 0 at the westernmost longitude. -
sources
public byte[] sourcesIf an associated .num file is provided with the .hgt file, this contains the code numbers identifying all unique sources of the elevation data in this tile. -
DEM_SRC_CODES
Mappings of NASADEM source code byte values to names of data sources as defined here. -
NO_CELL
public static final short NO_CELLReserved value indicating the elevation at the specified grid point is unknown.- See Also:
-
-
Constructor Details
-
SRTMTile
public SRTMTile()
-
-
Method Details
-
toString
Returns a string representation of the object. -
setCoord
Set the lower-left corner coordinates of this tile.- Parameters:
id
- SRTMTileId to obtain coordinates from
-
loadZip
Read a zipped tile file into this in-memory data structure- Parameters:
srtmFile
- File object describing the file to readlat
- latitude in whole degrees North for the tilelon
- longitude in whole degrees East for the tile- Throws:
IOException
- if the file could not be successfully read for any reason
-
loadGzip
Read a tile file into this in-memory data structure- Parameters:
srtmFile
- File object describing the file to readlat
- latitude in whole degrees North for the tilelon
- longitude in whole degrees East for the tile- Throws:
IOException
- if the file could not be successfully read for any reason
-
getSize
public int getSize()Report the amount of memory consumed by this tile. Can be used to dynamically size the cache of SRTMTiles to prevent heap overload. This estimate is based on the behavior of 32-bit JVM memory management.- Returns:
- estimated heap consumption of this SRTMTile and its sub-objects in bytes
-