com.bbn.openmap.dataAccess.dted
Class StandardDTEDNameTranslator

java.lang.Object
  extended by com.bbn.openmap.dataAccess.dted.StandardDTEDNameTranslator
All Implemented Interfaces:
DTEDNameTranslator

public class StandardDTEDNameTranslator
extends java.lang.Object
implements DTEDNameTranslator

A class implementing the DTEDNameTranslator interface that handles DTED file names as specified in the DTED specification. These file names follow this naming convention:

 
 
  dted/[e|w]xxx/[n|s]yy.dt[level]
 
  
 


Field Summary
protected  boolean DEBUG
           
protected  java.lang.String dtedDir
           
protected  java.lang.String filename
           
protected  double lat
           
protected  int level
           
protected  double lon
           
protected  java.lang.String subDirs
           
 
Constructor Summary
StandardDTEDNameTranslator()
          Constructor for object to use for multiple translations.
StandardDTEDNameTranslator(double lat, double lon, int level)
          Assuming that the DTED directory will be set, set the other parameters to reveal a path to a file name, which would be retrieved by calling getName().
StandardDTEDNameTranslator(java.lang.String dtedDir, double lat, double lon, int level)
          Set the internal parameters given a parent DTED directory, latitude, longitude and level.
 
Method Summary
protected  java.lang.String evaluate(double lat, double lon, int level)
          Update all the other settings based on these.
protected  void evaluate(java.lang.String filePath)
          Update all the other settings based on these.
 java.lang.String getDTEDDir()
          Get the path to the top-level DTED directory.
 java.lang.String getFileName()
          Get the file name.
 double getLat()
          Get the latitude.
 int getLevel()
          Get the DTED level set in the translator.
 double getLon()
          Get the longitude.
 java.lang.String getName()
          Get the complete path to the DTED frame file based on the current internal settings.
 java.lang.String getSubDirs()
          Get the relative part of the path to the DTED frame file, from just under the top-level dted directory to just above the frame file.
static void main(java.lang.String[] argv)
           
 void set(double lat, double lon, int level)
          Assuming that the DTED directory is set, set the other parameters to reveal a path to a file name, which would be retrieved by calling getName().
 void set(java.lang.String filePath)
          Set the internal parameters based on the given file path.
 void set(java.lang.String dtedDir, double lat, double lon, int level)
          Set the internal parameters given a parent DTED directory, latitude, longitude and level.
 void setDTEDDir(java.lang.String dtedDirectory)
          Set the top-level DTED directory.
 void setLat(double latitude)
          Set the latitude in the translator.
 void setLevel(int level)
          Set the DTED level in the translator.
 void setLon(double longitude)
          Set the longitude in the translator.
 void setName(java.lang.String fileName)
          Configure the internal settings based on a path to a DTED frame file.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

protected boolean DEBUG

filename

protected java.lang.String filename

subDirs

protected java.lang.String subDirs

dtedDir

protected java.lang.String dtedDir

lat

protected double lat

lon

protected double lon

level

protected int level
Constructor Detail

StandardDTEDNameTranslator

public StandardDTEDNameTranslator()
Constructor for object to use for multiple translations.


StandardDTEDNameTranslator

public StandardDTEDNameTranslator(java.lang.String dtedDir,
                                  double lat,
                                  double lon,
                                  int level)
Set the internal parameters given a parent DTED directory, latitude, longitude and level. getName can be called to fetch a file name for these parameters.

Parameters:
dtedDir - the path to the top DTED directory.
lat - the desired latitude, in decimal degrees.
lon - the desired longitude, in decimal degrees.
level - the DTED level (0, 1, 2).

StandardDTEDNameTranslator

public StandardDTEDNameTranslator(double lat,
                                  double lon,
                                  int level)
Assuming that the DTED directory will be set, set the other parameters to reveal a path to a file name, which would be retrieved by calling getName().

Parameters:
lat - the desired latitude, in decimal degrees.
lon - the desired longitude, in decimal degrees.
level - the DTED level (0, 1, 2).
Method Detail

set

public void set(java.lang.String filePath)
         throws FormatException
Set the internal parameters based on the given file path.

Specified by:
set in interface DTEDNameTranslator
Parameters:
filePath - a path to a dted frame file.
Throws:
FormatException

set

public void set(java.lang.String dtedDir,
                double lat,
                double lon,
                int level)
Set the internal parameters given a parent DTED directory, latitude, longitude and level. getName can be called to fetch a file name for these parameters.

Specified by:
set in interface DTEDNameTranslator
Parameters:
dtedDir - the path to the top DTED directory.
lat - the desired latitude, in decimal degrees.
lon - the desired longitude, in decimal degrees.
level - the DTED level (0, 1, 2).

set

public void set(double lat,
                double lon,
                int level)
Assuming that the DTED directory is set, set the other parameters to reveal a path to a file name, which would be retrieved by calling getName().

Specified by:
set in interface DTEDNameTranslator
Parameters:
lat - the desired latitude, in decimal degrees.
lon - the desired longitude, in decimal degrees.
level - the DTED level (0, 1, 2).

setLat

public void setLat(double latitude)
Set the latitude in the translator.

Specified by:
setLat in interface DTEDNameTranslator
Parameters:
latitude - the desired latitude, in decimal degrees.

getLat

public double getLat()
Get the latitude.

Specified by:
getLat in interface DTEDNameTranslator

setLon

public void setLon(double longitude)
Set the longitude in the translator.

Specified by:
setLon in interface DTEDNameTranslator
Parameters:
longitude - the desired longitude, in decimal degrees.

getLon

public double getLon()
Get the longitude.

Specified by:
getLon in interface DTEDNameTranslator

setLevel

public void setLevel(int level)
Set the DTED level in the translator.

Specified by:
setLevel in interface DTEDNameTranslator
Parameters:
level - the DTED level (0, 1, 2).

getLevel

public int getLevel()
Get the DTED level set in the translator.

Specified by:
getLevel in interface DTEDNameTranslator

getSubDirs

public java.lang.String getSubDirs()
Get the relative part of the path to the DTED frame file, from just under the top-level dted directory to just above the frame file.

Specified by:
getSubDirs in interface DTEDNameTranslator

getFileName

public java.lang.String getFileName()
Get the file name.

Specified by:
getFileName in interface DTEDNameTranslator

getName

public java.lang.String getName()
Get the complete path to the DTED frame file based on the current internal settings.

Specified by:
getName in interface DTEDNameTranslator

setName

public void setName(java.lang.String fileName)
             throws FormatException
Configure the internal settings based on a path to a DTED frame file.

Specified by:
setName in interface DTEDNameTranslator
Throws:
FormatException

setDTEDDir

public void setDTEDDir(java.lang.String dtedDirectory)
Set the top-level DTED directory.

Specified by:
setDTEDDir in interface DTEDNameTranslator

getDTEDDir

public java.lang.String getDTEDDir()
Get the path to the top-level DTED directory.

Specified by:
getDTEDDir in interface DTEDNameTranslator

evaluate

protected java.lang.String evaluate(double lat,
                                    double lon,
                                    int level)
Update all the other settings based on these.


evaluate

protected void evaluate(java.lang.String filePath)
                 throws FormatException
Update all the other settings based on these.

Throws:
FormatException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] argv)


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details