|
||||||||||
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
public class 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-existent if some of the directories or filenames have be transformed to uppercase.
Field Summary | |
---|---|
protected boolean |
aTocByteOrder
|
protected java.lang.String |
aTocFilePath
|
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 long |
estimateDiskSpace
|
protected boolean |
fullPathsInATOC
Flag to note whether absolute pathnames are used in the A.TOC. |
protected RpfHeader |
head
|
protected int |
indexRecordLength
|
static java.lang.String |
LITTLE_RPF_TOC_FILE_NAME
|
protected RpfFileSections.RpfLocationRecord[] |
locations
|
protected int |
numBoundaries
|
protected long |
numFrameIndexRecords
|
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 void |
figureOutChartSeriesForEntries(BinaryFile binFile)
Method that looks at one frame file for each RpfTocEntry, in order to check the suffix and load the chart series information into the RpfTocEntry. |
protected int |
getASCIIZone(double ullat,
int zone)
|
java.lang.String |
getATocFilePath()
|
java.util.List<RpfTocEntry> |
getBestCoverageEntry(double ullat,
double ullon,
double lrlat,
double lrlon,
Projection 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(double ullat,
double ullon,
double lrlat,
double lrlon,
Projection proj,
java.lang.String chartSeriesCode,
java.util.Vector<RpfCoverageBox> 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(double ullat,
double 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(double upperLat,
char zone)
|
protected static boolean |
isBelowZone(double lowerLat,
char zone)
|
boolean |
isFullPathsInATOC()
|
boolean |
isIgnoreZonesForCoverageBoxes()
|
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. |
protected void |
loadFrameInformation(RpfTocEntry rpfTocEntry)
Should be called by the RpfFrameCacheHandler before any frame files are loaded from a RpfTocEntry. |
static void |
main(java.lang.String[] args)
|
protected boolean |
parseToc(BinaryFile binFile)
|
protected void |
readFrameInformation(BinaryFile binFile,
RpfTocEntry entry)
Reads the BinaryFile to retrieve the Frame file information for the entry. |
boolean |
reload()
Re-read the A.TOC file in the parent directory. |
void |
setATocFilePath(java.lang.String tocFilePath)
|
void |
setFullPathsInATOC(boolean fullPathsInATOC)
|
void |
setIgnoreZonesForCoverageBoxes(boolean ignoreZonesForCoverageBoxes)
|
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 java.lang.String aTocFilePath
protected boolean aTocByteOrder
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 numFrameIndexRecords
protected int indexRecordLength
protected long currencyTime
protected boolean valid
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)
protected void figureOutChartSeriesForEntries(BinaryFile binFile) throws java.io.IOException, FormatException
binFile
-
java.io.IOException
FormatException
protected void loadFrameInformation(RpfTocEntry rpfTocEntry)
protected void readFrameInformation(BinaryFile binFile, RpfTocEntry entry) throws java.io.IOException, FormatException
binFile
- a valid, open BinaryFile.entry
- the RpfTocEntry to fill.
java.io.IOException
FormatException
public static java.lang.String translateScaleToSeries(long scale)
public static long textScaleToLong(java.lang.String textScale)
protected int getASCIIZone(double ullat, int zone)
public void getCatalogCoverage(double ullat, double ullon, double lrlat, double lrlon, Projection proj, java.lang.String chartSeriesCode, java.util.Vector<RpfCoverageBox> 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 coveragespublic java.util.List<RpfTocEntry> getBestCoverageEntry(double ullat, double ullon, double lrlat, double lrlon, Projection 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(double ullat, double lrlat, char zone)
public static boolean isOkZone(char zone, char[] okZones)
protected static boolean isBelowZone(double lowerLat, char zone)
protected static boolean isAboveZone(double 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 java.lang.String getATocFilePath()
public void setATocFilePath(java.lang.String tocFilePath)
public boolean isFullPathsInATOC()
public void setFullPathsInATOC(boolean fullPathsInATOC)
public boolean isIgnoreZonesForCoverageBoxes()
public void setIgnoreZonesForCoverageBoxes(boolean ignoreZonesForCoverageBoxes)
ignoreZonesForCoverageBoxes
- the ignoreZonesForCoverageBoxes to setpublic static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |