|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.layer.dted.DTEDFrame
The DTEDFrame is the representation of the DTED (Digital Terrain Elevation Data) data from a single dted data file. It keeps track of all the attribute information of it's data, and also maintains an array of images (DTEDFrameSubframe) that represent views of the elevation posts.
Field Summary | |
static int |
ACC_SIZE
|
static int |
ACC_SR_SIZE
|
protected BinaryFile |
binFile
The binary buffered file to read the data from the file. |
DTEDFrameColorTable |
colorTable
The colortable used to create the images. |
DTEDFrameDSI |
dsi
Data set indentification section of the file. |
static int |
DSI_SIZE
|
protected short[][] |
elevations
The array of elevation posts. |
boolean |
frame_is_valid
Validity flag for the quality of the data file. |
int |
number_horiz_subframes
The frame image is divided into 200x200 pixel subframes, with a leftover frame at the end. |
int |
number_vert_subframes
The frame image is divided into 200x200 pixel subframes, with a leftover frame at the end. |
protected java.lang.String |
path
The path to the frame, including the frame name. |
DTEDFrameSubframeInfo |
subframeInfo
The subframe presentation attributes. |
DTEDFrameSubframe[][] |
subframes
The image array for the subframes. |
DTEDFrameUHL |
uhl
User header label section of the file. |
static int |
UHL_SIZE
|
Constructor Summary | |
DTEDFrame(java.lang.String filePath)
Simplest constructor. |
|
DTEDFrame(java.lang.String filePath,
boolean readWholeFile)
Constructor with colortable and presentation information. |
|
DTEDFrame(java.lang.String filePath,
DTEDFrameColorTable cTable,
DTEDFrameSubframeInfo info)
Constructor with colortable and presentation information. |
|
DTEDFrame(java.lang.String filePath,
DTEDFrameColorTable cTable,
DTEDFrameSubframeInfo info,
boolean readWholeFile)
Constructor with colortable and presentation information. |
Method Summary | |
boolean |
close(boolean done)
Part of the Closable interface. |
void |
dispose()
This must get called to break a reference cycle that prevents the garbage collection of frames. |
int |
elevationAt(float lat,
float lon)
The elevation at the closest SW post to the given lat/lon. |
DTEDFrameColorTable |
getColorTable()
|
short[][] |
getElevations(float ullat,
float ullon,
float lrlat,
float lrlon)
Return a two dimensional array of posts between lat lons. |
short[][] |
getElevations(int startx,
int starty,
int endx,
int endy)
Return a two dimensional array of posts between lat lons. |
int[] |
getIndexesFromLatLons(float ullat,
float ullon,
float lrlat,
float lrlon)
Return an index of ints representing the starting x, y and ending x, y of elevation posts given a lat lon box. |
OMRaster |
getOMRaster(DTEDFrameSubframeInfo dfsi,
DTEDFrameColorTable colortable,
EqualArc proj)
If you just want to get an image for the DTEDFrame, then call this. |
OMRaster |
getOMRaster(EqualArc proj)
If you just want to get an image for the DTEDFrame, then call this. |
OMRaster |
getSubframeOMRaster(DTEDFrameSubframeInfo dfsi,
DTEDFrameColorTable colortable)
Return the subframe image as described in the DTEDFrameSubframeInfo. |
void |
initSubframes(int numHorizSubframes,
int numVertSubframes)
Sets the subframe array. |
int |
interpElevationAt(float lat,
float lon)
Interpolated elevation at a given lat/lon - should be more precise than elevationAt(), but that depends on the resolution of the data. |
static void |
main(java.lang.String[] args)
|
protected boolean |
read_data_record(int lon_index)
Reads one longitude line of posts. |
protected boolean |
read_data_records()
Read all the elevation posts, at one time. |
protected void |
read(BinaryFile binFile,
boolean readWholeFile)
Reads the DTED frame file. |
protected boolean |
reopen()
If the BinaryBufferedFile was closed, this method attempts to reopen it. |
void |
setColorTable(DTEDFrameColorTable c_Table)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UHL_SIZE
public static final int DSI_SIZE
public static final int ACC_SIZE
public static final int ACC_SR_SIZE
protected BinaryFile binFile
protected java.lang.String path
protected short[][] elevations
public DTEDFrameDSI dsi
public DTEDFrameUHL uhl
public DTEDFrameColorTable colorTable
public DTEDFrameSubframeInfo subframeInfo
public boolean frame_is_valid
public int number_horiz_subframes
public int number_vert_subframes
public DTEDFrameSubframe[][] subframes
Constructor Detail |
public DTEDFrame(java.lang.String filePath)
filePath
- complete path to the DTED frame.public DTEDFrame(java.lang.String filePath, DTEDFrameColorTable cTable, DTEDFrameSubframeInfo info)
filePath
- complete path to the DTED frame.cTable
- the colortable to use for the images.info
- presentation parameters.public DTEDFrame(java.lang.String filePath, boolean readWholeFile)
filePath
- complete path to the DTED frame.readWholeFile
- If true, all of the elevation data will be
read at load time. If false, elevation post data will be
read in per longitude column depending on the need.
False is recommended for DTEd level 1 and 2.public DTEDFrame(java.lang.String filePath, DTEDFrameColorTable cTable, DTEDFrameSubframeInfo info, boolean readWholeFile)
filePath
- complete path to the DTED frame.cTable
- the colortable to use for the images.info
- presentation parameters.readWholeFile
- If true, all of the elevation data will be
read at load time. If false, elevation post data will be
read in per longitude column depending on the need.
False is recommended for DTED level 1 and 2.Method Detail |
public void setColorTable(DTEDFrameColorTable c_Table)
public DTEDFrameColorTable getColorTable()
protected void read(BinaryFile binFile, boolean readWholeFile)
binFile
- the binary buffere file opened on the DTED frame
filereadWholeFile
- flag controlling whether all the row data
is read at this time. Otherwise, the rows are read as
needed.public void dispose()
public boolean close(boolean done)
close
in interface Closable
done
- true
indicates that this is a
permanent closure. false
indicates that
the object may be used again later, as this is only an
attempt to temporarily reclaim resources
true
indicates the object is still
usable. false
indicates that the object
is now unusable, and any references to it should be
released so the garbage collector can do its job.protected boolean reopen()
public int elevationAt(float lat, float lon)
lat
- latitude in decimal degrees.lon
- longitude in decimal degrees.
public int interpElevationAt(float lat, float lon)
lat
- latitude in decimal degrees.lon
- longitude in decimal degrees.
public int[] getIndexesFromLatLons(float ullat, float ullon, float lrlat, float lrlon)
ullat
- upper latitude in decimal degrees.ullon
- left longitude in decimal degrees.lrlat
- lower latitude in decimal degrees.lrlon
- right longitude in decimal degrees.
public short[][] getElevations(float ullat, float ullon, float lrlat, float lrlon)
ullat
- upper latitude in decimal degrees.ullon
- left longitude in decimal degrees.lrlat
- lower latitude in decimal degrees.lrlon
- right longitude in decimal degrees.
public short[][] getElevations(int startx, int starty, int endx, int endy)
startx
- starting index (left) of the greater matrix to
make the left side of the returned matrix.starty
- starting index (lower) of the greater matrix to
make the bottom side of the returned matrix.endx
- ending index (right) of the greater matrix to make
the left side of the returned matrix.endy
- ending index (top) of the greater matrix to make
the top side of the returned matrix.
protected boolean read_data_record(int lon_index)
protected boolean read_data_records()
public void initSubframes(int numHorizSubframes, int numVertSubframes)
public OMRaster getOMRaster(EqualArc proj)
proj
- EqualArc projection to use to create image.
public OMRaster getOMRaster(DTEDFrameSubframeInfo dfsi, DTEDFrameColorTable colortable, EqualArc proj)
dfsi
- the DTEDFrameSubframeInfo describing the subframe.colortable
- the colortable to use when building the
image.proj
- EqualArc projection to use to create image.
public OMRaster getSubframeOMRaster(DTEDFrameSubframeInfo dfsi, DTEDFrameColorTable colortable)
dfsi
- the DTEDFrameSubframeInfo describing the subframe.colortable
- the colortable to use when building the
image.
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |