|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.layer.rpf.RpfTocHandler
The RpfTocHandler knows how to read A.TOC files for RPF raster data. The A.TOC file describes the coverage found in the tree of data that accompanies it. This coverage is described as a series of rectangles describing the frame of groups of coverage, with common-scale maps, types for different CADRG zones. The RpfTocHandler can also provide a description of the frames and subframes to use for a screen with a given projection.
The RPF specification says that the frame paths and file names, from the RPF directory, should be in upper-case letters. The paths and file names are stored in the A.TOC file this way. Sometimes, however, through CDROM and downloading quirks, the paths and file names, as stored on the hard drive, are actually transferred to lower-case letters. This RpfTocHandler will check for lower case letter paths, but only for all the letters to be lower case. The frame will be marked as non-existant if some of the directories or filenames have be transformed to uppercase.
Field Summary | |
protected BinaryFile |
binFile
|
protected long |
currencyTime
|
protected boolean |
Dchum
|
protected boolean |
DEBUG_RPF
|
protected boolean |
DEBUG_RPFTOC
|
protected boolean |
DEBUG_RPFTOCDETAIL
|
protected boolean |
DEBUG_RPFTOCFRAMEDETAIL
|
static int |
DEFAULT_FRAME_SPACE
|
protected java.lang.String |
dir
|
protected RpfTocEntry[] |
entries
The boundary rectangles in the A.TOC file. |
protected java.util.Vector |
entryResponses
Used to return the valid entries for a coverage query. |
protected long |
estimateDiskSpace
|
protected boolean |
fullPathsInATOC
Flag to note whether absolute pathnames are used in the A.TOC. |
protected RpfHeader |
head
|
static java.lang.String |
LITTLE_RPF_TOC_FILE_NAME
|
protected RpfFileSections.RpfLocationRecord[] |
locations
|
protected int |
numBoundaries
|
static java.lang.String |
RPF_TOC_FILE_NAME
|
protected boolean |
valid
|
Constructor Summary | |
RpfTocHandler()
|
|
RpfTocHandler(java.lang.String parentDir)
Should be used in situations where it is certain that this is the only A.TOC in town. |
|
RpfTocHandler(java.lang.String parentDir,
int TOCNumber)
Used when there is more than one A.TOC being used, or where there is a possibility of that happening, like in the RPF layer. |
Method Summary | |
protected int |
getASCIIZone(float ullat,
int zone)
|
java.util.List |
getBestCoverageEntry(float ullat,
float ullon,
float lrlat,
float lrlon,
CADRG proj,
RpfViewAttributes viewAtts)
Given a coordinate box and a scale, find the entry in the table of contents file with the right data. |
void |
getCatalogCoverage(float ullat,
float ullon,
float lrlat,
float lrlon,
CADRG proj,
java.lang.String chartSeriesCode,
java.util.Vector coverages)
Given a coordinate box and a scale, return the entries that have coverage over the given area. |
RpfTocEntry[] |
getEntries()
Return the list of grouped frames. |
static char |
getHigherZone(char zone)
|
static char |
getLowerZone(char zone)
|
static float |
getLowerZoneExtent(char zone)
|
static char[] |
getOkZones(float ullat,
float lrlat,
char zone)
|
java.io.File |
getTocFile(java.lang.String parentDir)
Given a parent RPF directory, find the a.toc file directly inside it, as dictated by the specification. |
static float |
getUpperZoneExtent(char zone)
|
boolean |
hasChanged()
A way to check if the status of the A.TOC file is different, in case another one has taken its place. |
protected static boolean |
isAboveZone(float upperLat,
char zone)
|
protected static boolean |
isBelowZone(float lowerLat,
char zone)
|
static boolean |
isOkZone(char zone,
char[] okZones)
|
boolean |
isValid()
True if the A.TOC file is readable/present/good. |
boolean |
loadFile(java.lang.String parentDir)
Read the file and load its parameters into this object. |
static void |
main(java.lang.String[] args)
|
protected boolean |
parseToc(BinaryFile binFile)
|
boolean |
reload()
Re-read the A.TOC file in the parent directory. |
static long |
textScaleToLong(java.lang.String textScale)
Given the scale string found in the A.TOC file, decode it into a 'long' scale. |
static java.lang.String |
translateScaleToSeries(long scale)
Util-like function that translates a long to the string representation found in the A>TOC file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String RPF_TOC_FILE_NAME
public static final java.lang.String LITTLE_RPF_TOC_FILE_NAME
public static final int DEFAULT_FRAME_SPACE
protected RpfHeader head
protected BinaryFile binFile
protected RpfFileSections.RpfLocationRecord[] locations
protected RpfTocEntry[] entries
protected java.lang.String dir
protected boolean Dchum
protected long estimateDiskSpace
protected int numBoundaries
protected long currencyTime
protected boolean valid
protected java.util.Vector entryResponses
protected boolean fullPathsInATOC
protected boolean DEBUG_RPF
protected boolean DEBUG_RPFTOC
protected boolean DEBUG_RPFTOCDETAIL
protected boolean DEBUG_RPFTOCFRAMEDETAIL
Constructor Detail |
public RpfTocHandler()
public RpfTocHandler(java.lang.String parentDir)
public RpfTocHandler(java.lang.String parentDir, int TOCNumber)
parentDir
- the RPF directoryTOCNumber
- a unique number to identify this TOC for a
RpfFrameProvider.Method Detail |
public java.io.File getTocFile(java.lang.String parentDir)
parentDir
- Path to the RPF directory.
public boolean isValid()
public boolean hasChanged()
public boolean reload()
public boolean loadFile(java.lang.String parentDir)
protected boolean parseToc(BinaryFile binFile)
public static java.lang.String translateScaleToSeries(long scale)
public static long textScaleToLong(java.lang.String textScale)
protected int getASCIIZone(float ullat, int zone)
public void getCatalogCoverage(float ullat, float ullon, float lrlat, float lrlon, CADRG proj, java.lang.String chartSeriesCode, java.util.Vector coverages)
ullat
- upper left latitude, in decimal degreesullon
- upper left longitude, in decimal degreeslrlat
- lower right latitude, in decimal degreeslrlon
- lower right longitude, in decimal degreesproj
- CADRG projection describing map.chartSeriesCode
- chart selection. If null, all coverage
boxes fitting on the screen will be returned.coverages
- a list of potential coverages
public java.util.List getBestCoverageEntry(float ullat, float ullon, float lrlat, float lrlon, CADRG proj, RpfViewAttributes viewAtts)
ullat
- upper left latitude, in decimal degreesullon
- upper left longitude, in decimal degreeslrlat
- lower right latitude, in decimal degreeslrlon
- lower right longitude, in decimal degreesproj
- CADRG projection describing map.viewAtts
- view attributes determine chart selection.
public static char[] getOkZones(float ullat, float lrlat, char zone)
public static boolean isOkZone(char zone, char[] okZones)
protected static boolean isBelowZone(float lowerLat, char zone)
protected static boolean isAboveZone(float upperLat, char zone)
public static float getUpperZoneExtent(char zone)
public static float getLowerZoneExtent(char zone)
public static char getLowerZone(char zone)
public static char getHigherZone(char zone)
public RpfTocEntry[] getEntries()
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |