com.bbn.openmap.layer.vpf
Class CoverageTable

java.lang.Object
  extended by com.bbn.openmap.layer.vpf.CoverageTable

public class CoverageTable
extends java.lang.Object

Encapsulate a VPF coverage directory. This class handles requests that happen for a particular coverage type (political boundary, road, etc.) for a particular library (north america, browse, etc.).


Nested Class Summary
static class CoverageTable.FeatureClassRec
          Feature Type Information read from VPF fca files.
 
Field Summary
 boolean appendDot
          do we need to append a '.' to three-character file names
static char AREA_FEATURETYPE
           
 FeatureClassInfo[] areainfo
          featureclasses used for the area feature type
 int[] cachedAreaSchema
          hack - used by AreaTable
 int[] cachedCPointSchema
          hack - used by nodetable
 int[] cachedEPointSchema
          hack - used by nodetable
 int[] cachedLineSchema
          hack - used by EdgeTable
 int[] cachedTextSchema
          hack - used by TextTable
protected  CoverageAttributeTable cat
          Need this in case we have to go from the coverage type-<feature type-<tile
static int[] charVDTschemalength
          expected schema lengths for char.vdt files
static char[] charVDTschematype
          expected schema types for char.vdt files
static char COMPLEX_FEATURETYPE
           
 java.lang.String covtype
          our coverage type - such as "po", "bnd", "hydro"
static char CPOINT_FEATURETYPE
           
 FeatureClassInfo[] cpointinfo
          featureclasses used for the connected node feature type
 boolean doAntarcticaWorkaround
          hackage for the antarctica polygon in DCW browse coverage
static char EDGE_FEATURETYPE
           
static char EPOINT_FEATURETYPE
           
 FeatureClassInfo[] epointinfo
          featureclasses used for the entity node feature type
protected  java.util.Hashtable<java.lang.String,CoverageTable.FeatureClassRec> featureTypeInfo
           
protected  java.util.Hashtable<java.lang.String,FeatureClassInfo> featureTypes
          Feature classes to look up FeatureClassInfo via feature name.
static int[] intVDTschemalength
          expected schema lengths for int.vdt files
static char[] intVDTschematype
          expected schema types for int.vdt files
 FeatureClassInfo[] lineinfo
          featureclasses used for the line feature type
protected static java.util.logging.Logger logger
           
static char SKIP_FEATURETYPE
           
protected  java.lang.String tablepath
          the directory for our coverage type
static char TEXT_FEATURETYPE
           
 FeatureClassInfo[] textinfo
          featureclasses used for the text feature type
static char UPOINT_FEATURETYPE
           
static java.lang.String[] VDTColumnNames
          required column names for char.vdt and int.vdt files
 
Constructor Summary
CoverageTable(java.lang.String path, java.lang.String covtype)
          Construct a CoverageTable object.
CoverageTable(java.lang.String path, java.lang.String covtype, CoverageAttributeTable cat)
          Construct a CoverageTable object.
 
Method Summary
 boolean drawFeatures(VPFFeatureWarehouse warehouse, LatLonPoint ll1, LatLonPoint ll2, float dpplat, float dpplon)
          This function uses the warehouse to get a list of features, and then looks in the featureList to see what feature tables handle those features.
protected  boolean drawFeaturesFromThematicIndex(FeatureClassInfo fci, VPFFeatureWarehouse warehouse, com.bbn.openmap.layer.vpf.TableHolder tables, LatLonPoint ll1, LatLonPoint ll2, float dpplat, float dpplon, java.lang.String currentFeature, char featureType)
          This function gets the thematic index from the FeatureClassInfo object, and uses it to look up the tiles that contain the currentFeature.
 void drawTile(TileDirectory drawtd, VPFGraphicWarehouse warehouse, LatLonPoint ll1, LatLonPoint ll2, float dpplat, float dpplon)
          Given a tile directory, go through the entries in the edg/fac/txt files, and send those entries to the warehouse.
 java.lang.String getAreaDescription(java.util.List<java.lang.Object> areaid, MutableInt retval)
           
 CoverageAttributeTable getCoverageAttributeTable()
           
 java.lang.String getCPointDescription(java.util.List<java.lang.Object> pointid, MutableInt retval)
           
 java.lang.String getDataPath()
          Get the path for this coverage
 java.lang.String getDescription(java.lang.String t, java.lang.String a, int v)
           
 java.lang.String getDescription(java.lang.String t, java.lang.String a, java.lang.String v)
           
 java.lang.String getEPointDescription(java.util.List<java.lang.Object> pointid, MutableInt retval)
           
 java.util.Map<java.lang.String,FeatureClassInfo> getFeatureClasses()
          Returns all the feature classes
 FeatureClassInfo getFeatureClassInfo(java.lang.String featureType)
          Returns the FeatureClassInfo object corresponding to the feature type.
 void getFeatures(VPFAutoFeatureGraphicWarehouse warehouse, LatLonPoint ll1, LatLonPoint ll2, double dpplat, double dpplon, OMGraphicList omgList)
          This is a method specifically designed for the VPFAutoFeatureGraphicWarehouse, and the CoverageTable knows to check with the warehouse and use the PriorityHolders to fetch features.
 java.util.Hashtable<java.lang.String,CoverageTable.FeatureClassRec> getFeatureTypeInfo()
          Returns a map from feature name to FeatureClassRec
 java.lang.String getLineDescription(java.util.List<java.lang.Object> lineid, MutableInt retval)
           
protected  OMGraphic getOMGraphicForFeature()
           
 java.lang.String getTextDescription(java.util.List<java.lang.Object> textid, MutableInt retval)
           
static void main(java.lang.String[] args)
           
 void setCoverateAttributeTable(CoverageAttributeTable cat)
           
protected  char whatFeatureType(VPFWarehouse warehouse, java.lang.String featureName)
          Given a feature type name, figure out if the warehouse thinks it should *NOT* be drawn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final java.util.logging.Logger logger

covtype

public final java.lang.String covtype
our coverage type - such as "po", "bnd", "hydro"


tablepath

protected final java.lang.String tablepath
the directory for our coverage type


cachedLineSchema

public int[] cachedLineSchema
hack - used by EdgeTable


cachedAreaSchema

public int[] cachedAreaSchema
hack - used by AreaTable


cachedTextSchema

public int[] cachedTextSchema
hack - used by TextTable


cachedEPointSchema

public int[] cachedEPointSchema
hack - used by nodetable


cachedCPointSchema

public int[] cachedCPointSchema
hack - used by nodetable


lineinfo

public FeatureClassInfo[] lineinfo
featureclasses used for the line feature type


areainfo

public FeatureClassInfo[] areainfo
featureclasses used for the area feature type


textinfo

public FeatureClassInfo[] textinfo
featureclasses used for the text feature type


epointinfo

public FeatureClassInfo[] epointinfo
featureclasses used for the entity node feature type


cpointinfo

public FeatureClassInfo[] cpointinfo
featureclasses used for the connected node feature type


featureTypes

protected java.util.Hashtable<java.lang.String,FeatureClassInfo> featureTypes
Feature classes to look up FeatureClassInfo via feature name.


featureTypeInfo

protected java.util.Hashtable<java.lang.String,CoverageTable.FeatureClassRec> featureTypeInfo

appendDot

public boolean appendDot
do we need to append a '.' to three-character file names


cat

protected CoverageAttributeTable cat
Need this in case we have to go from the coverage type-<feature type-<tile


doAntarcticaWorkaround

public final boolean doAntarcticaWorkaround
hackage for the antarctica polygon in DCW browse coverage


EDGE_FEATURETYPE

public static final char EDGE_FEATURETYPE
See Also:
Constant Field Values

AREA_FEATURETYPE

public static final char AREA_FEATURETYPE
See Also:
Constant Field Values

TEXT_FEATURETYPE

public static final char TEXT_FEATURETYPE
See Also:
Constant Field Values

UPOINT_FEATURETYPE

public static final char UPOINT_FEATURETYPE
See Also:
Constant Field Values

EPOINT_FEATURETYPE

public static final char EPOINT_FEATURETYPE
See Also:
Constant Field Values

CPOINT_FEATURETYPE

public static final char CPOINT_FEATURETYPE
See Also:
Constant Field Values

COMPLEX_FEATURETYPE

public static final char COMPLEX_FEATURETYPE
See Also:
Constant Field Values

SKIP_FEATURETYPE

public static final char SKIP_FEATURETYPE
See Also:
Constant Field Values

VDTColumnNames

public static final java.lang.String[] VDTColumnNames
required column names for char.vdt and int.vdt files


intVDTschematype

public static final char[] intVDTschematype
expected schema types for int.vdt files


intVDTschemalength

public static final int[] intVDTschemalength
expected schema lengths for int.vdt files


charVDTschematype

public static final char[] charVDTschematype
expected schema types for char.vdt files


charVDTschemalength

public static final int[] charVDTschemalength
expected schema lengths for char.vdt files

Constructor Detail

CoverageTable

public CoverageTable(java.lang.String path,
                     java.lang.String covtype)
Construct a CoverageTable object. Data is expected to be in a directory called path/covtype.

Parameters:
path - the path to the parent directory of where our data resides
covtype - the subdirectory name for the coverage data

CoverageTable

public CoverageTable(java.lang.String path,
                     java.lang.String covtype,
                     CoverageAttributeTable cat)
Construct a CoverageTable object. Data is expected to be in a directory called path/covtype.

Parameters:
path - the path to the parent directory of where our data resides
covtype - the subdirectory name for the coverage data
cat - the CoverageAttributeTable reference, in case we need to backtrack the tiles through the feature tables.
Method Detail

getDataPath

public java.lang.String getDataPath()
Get the path for this coverage


getFeatureClasses

public java.util.Map<java.lang.String,FeatureClassInfo> getFeatureClasses()
Returns all the feature classes


getFeatureClassInfo

public FeatureClassInfo getFeatureClassInfo(java.lang.String featureType)
Returns the FeatureClassInfo object corresponding to the feature type. Returns null if the featureType doesn't exist.

Parameters:
featureType - the name of the feature to get
Returns:
the feature class object for the feature type

getDescription

public java.lang.String getDescription(java.lang.String t,
                                       java.lang.String a,
                                       int v)

getDescription

public java.lang.String getDescription(java.lang.String t,
                                       java.lang.String a,
                                       java.lang.String v)

getLineDescription

public java.lang.String getLineDescription(java.util.List<java.lang.Object> lineid,
                                           MutableInt retval)

getTextDescription

public java.lang.String getTextDescription(java.util.List<java.lang.Object> textid,
                                           MutableInt retval)

getEPointDescription

public java.lang.String getEPointDescription(java.util.List<java.lang.Object> pointid,
                                             MutableInt retval)

getCPointDescription

public java.lang.String getCPointDescription(java.util.List<java.lang.Object> pointid,
                                             MutableInt retval)

getAreaDescription

public java.lang.String getAreaDescription(java.util.List<java.lang.Object> areaid,
                                           MutableInt retval)

setCoverateAttributeTable

public void setCoverateAttributeTable(CoverageAttributeTable cat)

getCoverageAttributeTable

public CoverageAttributeTable getCoverageAttributeTable()

drawTile

public void drawTile(TileDirectory drawtd,
                     VPFGraphicWarehouse warehouse,
                     LatLonPoint ll1,
                     LatLonPoint ll2,
                     float dpplat,
                     float dpplon)
Given a tile directory, go through the entries in the edg/fac/txt files, and send those entries to the warehouse. The warehouse will check their feature names with the feature names given to it in its properties, and eliminate the ones that it shouldn't draw.


drawFeatures

public boolean drawFeatures(VPFFeatureWarehouse warehouse,
                            LatLonPoint ll1,
                            LatLonPoint ll2,
                            float dpplat,
                            float dpplon)
This function uses the warehouse to get a list of features, and then looks in the featureList to see what feature tables handle those features. Using the appropriate feature table, the function then tracks down the tile that contains that feature, and the feature index into that tile file, and then contacts the warehouse to get that feature created into a graphic.


drawFeaturesFromThematicIndex

protected boolean drawFeaturesFromThematicIndex(FeatureClassInfo fci,
                                                VPFFeatureWarehouse warehouse,
                                                com.bbn.openmap.layer.vpf.TableHolder tables,
                                                LatLonPoint ll1,
                                                LatLonPoint ll2,
                                                float dpplat,
                                                float dpplon,
                                                java.lang.String currentFeature,
                                                char featureType)
This function gets the thematic index from the FeatureClassInfo object, and uses it to look up the tiles that contain the currentFeature. Then, that tile is checked to see if it is on the map. If it is, then that row in the thematic index is read to get the feature id numbers. The feature table is referenced for the feature ID number in the tile, and then the feature is drawn.

Parameters:
fci - the FeatureClassInfo (feature table)
warehouse - the VPFFeatureGraphicWarehouse to use to draw the graphics.
ll1 - the upper left corner of the map.
ll2 - the lower right corner of the map.
dpplat - degrees per pixel latitude direction.
dpplon - degrees per pixel longitude direction.
currentFeature - the feature string (roadl)
featureType - the CoverageTable letter representation of the feature type.

getFeatures

public void getFeatures(VPFAutoFeatureGraphicWarehouse warehouse,
                        LatLonPoint ll1,
                        LatLonPoint ll2,
                        double dpplat,
                        double dpplon,
                        OMGraphicList omgList)
                 throws FormatException
This is a method specifically designed for the VPFAutoFeatureGraphicWarehouse, and the CoverageTable knows to check with the warehouse and use the PriorityHolders to fetch features.

Parameters:
warehouse - VPFAutoFeatureGraphicWarehouse
ll1 - upper left of coverage area
ll2 - lower right of coverage area
dpplat - degrees/pixel vertically
dpplon - degrees/pixel horizontally
omgList - The OMGraphicList to add OMGraphics, representing features.
Throws:
FormatException - if something goes wrong reading files, this exception will be thrown.

getOMGraphicForFeature

protected OMGraphic getOMGraphicForFeature()

whatFeatureType

protected char whatFeatureType(VPFWarehouse warehouse,
                               java.lang.String featureName)
Given a feature type name, figure out if the warehouse thinks it should *NOT* be drawn.

Parameters:
warehouse - the warehouse to build the graphics.
featureName - the VPF name of the feature (polbndl, for example).
Returns:
SKIP_FEATURETYPE if the feature should not be drawn.

getFeatureTypeInfo

public java.util.Hashtable<java.lang.String,CoverageTable.FeatureClassRec> getFeatureTypeInfo()
Returns a map from feature name to FeatureClassRec


main

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


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