|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.dataAccess.dted.DTEDFrame
public class 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 its data. It can return an OMGrid object that can be configured to create a visual representation of the data, depending on what OMGridGenerators are used on the OMGrid object.
Field Summary | |
---|---|
DTEDFrameACC |
acc
Accuracy description section of the file. |
static int |
ACC_SIZE
|
static int |
ACC_SR_SIZE
|
protected BinaryFile |
binFile
The binary buffered file to read the data from the file. |
DTEDFrameDSI |
dsi
Data set identification 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. |
protected java.lang.String |
path
The path to the frame, including the frame name. |
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. |
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. |
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. |
OMGraphic |
getImage(Projection proj)
If you just want to get an image for the DTEDFrame, then call this. |
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. |
OMGrid |
getOMGrid()
|
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 void |
read(BinaryFile binFile,
boolean readWholeFile)
Reads the DTED frame file. |
protected boolean |
readDataRecord(int lon_index)
Reads one longitude line of posts. |
protected boolean |
readDataRecords()
Read all the elevation posts, at one time. |
protected boolean |
reopen()
If the BinaryBufferedFile was closed, this method attempts to reopen it. |
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 DTEDFrameACC acc
public boolean frame_is_valid
Constructor Detail |
---|
public DTEDFrame(java.lang.String filePath)
filePath
- complete path to the DTED frame.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.Method Detail |
---|
protected void read(BinaryFile binFile, boolean readWholeFile)
binFile
- the binary buffered 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 readDataRecord(int lon_index)
protected boolean readDataRecords()
public OMGrid getOMGrid()
public OMGraphic getImage(Projection proj)
proj
- EqualArc projection to use to create 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 |