com.bbn.openmap.dataAccess.dted
Class DTEDLocator

java.lang.Object
  extended by com.bbn.openmap.util.wanderer.Wanderer
      extended by com.bbn.openmap.dataAccess.dted.DTEDLocator
All Implemented Interfaces:
WandererCallback

public class DTEDLocator
extends Wanderer
implements WandererCallback

DTEDLocator finds DTED frame files, and organizes them by level, longitude and latitude.

 
  Usage: java com.bbn.openmap.dataAccess.dted.DTEDLocator (dir path) ...
 
 


Field Summary
protected  java.util.LinkedList filenames
           
protected  java.io.File[][][] files
           
protected  int numLevels
           
protected  DTEDNameTranslator translator
           
 
Fields inherited from class com.bbn.openmap.util.wanderer.Wanderer
exhaustiveSearch, topToBottom
 
Constructor Summary
DTEDLocator()
          Create a DTEDLocator, expect to set the top level DTED directory later.
DTEDLocator(java.io.File dtedDir)
          Create the DTEDLocator and start searching from the directory specificed.
DTEDLocator(java.lang.String directory)
          Create the DTEDLocator and start searching from the directory specificed.
 
Method Summary
 java.io.File get(float lat, float lon, int level)
          Get the File object for a latitude, longitude and level.
 DTEDNameTranslator getTranslator()
          Get the DTEDNameTranslator that knows how to interpret where a DTED file covers based on its name.
 boolean handleDirectory(java.io.File directory)
          Does nothing, nothing is done for directories.
 boolean handleFile(java.io.File file)
          When a file is found, add it.
protected  void initFileHolder()
          Initialize the holding arrays.
static void main(java.lang.String[] argv)
          Given a set of files or directories, parade through them to find files that end with '`', or files that start with '.#', and delete them.
 void organize()
          After all the files have been located, organized them spatially in the 3D array.
 void setTranslator(DTEDNameTranslator dnt)
          Set the DTEDNameTranslator that knows how to interpret where a DTED file covers based on its name.
 
Methods inherited from class com.bbn.openmap.util.wanderer.Wanderer
getCallback, handleDirectory, handleEntry, isExhaustiveSearch, isTopToBottom, setCallback, setExhaustiveSearch, setTopToBottom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

translator

protected DTEDNameTranslator translator

filenames

protected java.util.LinkedList filenames

files

protected java.io.File[][][] files

numLevels

protected int numLevels
Constructor Detail

DTEDLocator

public DTEDLocator()
Create a DTEDLocator, expect to set the top level DTED directory later.


DTEDLocator

public DTEDLocator(java.lang.String directory)
Create the DTEDLocator and start searching from the directory specificed.


DTEDLocator

public DTEDLocator(java.io.File dtedDir)
Create the DTEDLocator and start searching from the directory specificed.

Method Detail

initFileHolder

protected void initFileHolder()
Initialize the holding arrays.


handleDirectory

public boolean handleDirectory(java.io.File directory)
Does nothing, nothing is done for directories.

Specified by:
handleDirectory in interface WandererCallback
Parameters:
directory - that represents a directory to deal with.
Returns:
true to continue wandering through to children.

handleFile

public boolean handleFile(java.io.File file)
When a file is found, add it.

Specified by:
handleFile in interface WandererCallback
Parameters:
file - to handle.
Returns:
true to continue evaluating siblings and parent directory siblings.

getTranslator

public DTEDNameTranslator getTranslator()
Get the DTEDNameTranslator that knows how to interpret where a DTED file covers based on its name.


setTranslator

public void setTranslator(DTEDNameTranslator dnt)
Set the DTEDNameTranslator that knows how to interpret where a DTED file covers based on its name.


organize

public void organize()
After all the files have been located, organized them spatially in the 3D array.


get

public java.io.File get(float lat,
                        float lon,
                        int level)
Get the File object for a latitude, longitude and level.


main

public static void main(java.lang.String[] argv)
Given a set of files or directories, parade through them to find files that end with '`', or files that start with '.#', and delete them.

Parameters:
argv - paths to files or directories, use -h to get a usage statement.


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