Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.layer.vpf
Class LibrarySelectionTable

    java.lang.Object
      com.bbn.openmap.layer.vpf.LibrarySelectionTable

public class LibrarySelectionTable
extends java.lang.Object

Reads the VPF LibraryAttribute table and constructs CoverageAttributeTables for each of the library coverages (north america, browse, etc) that exist.

NOTE: This class maintains a whole bunch of cached information, and also hangs onto references to classes that cache even more information. When using this class, you are much better off sharing an instance of this class, rather than creating multiple instantiations of it for the same VPF data directory.

See Also:
  `CoverageAttributeTable`

Field Summary
`protected int` | `BROWSE_CUTOFF`
`static int` | `DEFAULT_BROWSE_CUTOFF` cutoff scale for browse coverage.

Constructor Summary
`LibrarySelectionTable()` Construct a LibrarySelectionTable without a path to data.
`LibrarySelectionTable(java.lang.String vpfpath)` Construct a LibrarySelectionTable with a path to data.
`LibrarySelectionTable(java.lang.String[] vpfpaths)` Construct a LibrarySelectionTable with a path to data.

Method Summary
`void` | `addDataPath(java.lang.String vpfpath)` add a path to LibrarySelectionTable.
`void` | `drawFeatures(int scale, int screenwidth, int screenheight, java.lang.String covname, VPFFeatureWarehouse warehouse, LatLonPoint ll1, LatLonPoint ll2)`
`void` | `drawTile(int scale, int screenwidth, int screenheight, java.lang.String covname, VPFGraphicWarehouse warehouse, LatLonPoint ll1, LatLonPoint ll2)`
`CoverageAttributeTable` | `getCAT(java.lang.String library)` Return the coverage attribute table (list of coverages available for the given library) for the given library name.
`int` | `getCutoffScale()` Get the cutoff scale where data will be retrieved.
`java.lang.String` | `getDatabaseDescription()` Return the description of the database we are reading from.
`java.lang.String` | `getDatabaseName()` Return the name of the database we are reading from.
`java.lang.String` | `getDescription(java.lang.String coverageOrFeatureType)` Given a string for a coverage type or feature type, return the description for that string.
`java.lang.String[]` | `getLibraryNames()` Return the list of libraries that this database has.
`static void` | `main(java.lang.String[] args)` Just a test main to parse vpf datafiles param args files to parse, plus other command line flags
`void` | `setCutoffScale(int scale)` Set the cutoff scale where if the map scale number is larger (smaller overall map scale), the coverage won't be returned.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_BROWSE_CUTOFF

    public static final int DEFAULT_BROWSE_CUTOFF

  cutoff scale for browse coverage.

  See Also:
    Constant Field Values

### BROWSE_CUTOFF

    protected int BROWSE_CUTOFF

Constructor Detail

### LibrarySelectionTable

    public LibrarySelectionTable()

  Construct a LibrarySelectionTable without a path to data.

### LibrarySelectionTable

    public LibrarySelectionTable(java.lang.String vpfpath)
                          throws FormatException

  Construct a LibrarySelectionTable with a path to data.

Parameters:
  `vpfpath` - the path to the base data directory; the file opened is `vpfpath` /lat.
Throws:
  `FormatException` - some error was encountered while trying to handle the file.

### LibrarySelectionTable

    public LibrarySelectionTable(java.lang.String[] vpfpaths)
                          throws FormatException

  Construct a LibrarySelectionTable with a path to data.

Parameters:
  `vpfpaths` - the paths to the data directories; the file opened is `vpfpath` /lat.
Throws:
  `FormatException` - some error was encountered while trying to handle the file.

Method Detail

### setCutoffScale

    public void setCutoffScale(int scale)

  Set the cutoff scale where if the map scale number is larger (smaller overall map scale), the coverage won't be returned. For example, if the scale cutoff is 30000000, if the map scale is 1:31000000, no map data will be returned.

### getCutoffScale

    public int getCutoffScale()

  Get the cutoff scale where data will be retrieved.

### addDataPath

    public void addDataPath(java.lang.String vpfpath)
                     throws FormatException

  add a path to LibrarySelectionTable. Adding different types of VPF libraries to the same LST is likely to cause trouble. (e.g. it would be bad to add both DCW and VMAP paths to the same LST. adding each DCW disk separately is why this method exists.)

  Parameters:
    `vpfpath` - the path to the base DCW directory; the file opened is `vpfpath` /lat.
  Throws:
    `FormatException` - some error was encountered while trying to handle the file.

### getLibraryNames

    public java.lang.String[] getLibraryNames()

  Return the list of libraries that this database has.

  Returns:
    the list of libraries. for DCW, this is typically NOAMER, BROWSE, etc.

### getDatabaseName

    public java.lang.String getDatabaseName()

  Return the name of the database we are reading from.

### getDatabaseDescription

    public java.lang.String getDatabaseDescription()

  Return the description of the database we are reading from.

### getCAT

    public CoverageAttributeTable getCAT(java.lang.String library)
                                  throws FormatException

  Return the coverage attribute table (list of coverages available for the given library) for the given library name.

  Parameters:
    `library` - the name of the library to get the CAT for
  Returns:
    the CoverageAttributeTable requested (null if the library requested doesn't exist in the database)
  Throws:
    `FormatException` - exceptions from opening the CAT for the library

### drawTile

    public void drawTile(int scale,
                         int screenwidth,
                         int screenheight,
                         java.lang.String covname,
                         VPFGraphicWarehouse warehouse,
                         LatLonPoint ll1,
                         LatLonPoint ll2)

### drawFeatures

    public void drawFeatures(int scale,
                             int screenwidth,
                             int screenheight,
                             java.lang.String covname,
                             VPFFeatureWarehouse warehouse,
                             LatLonPoint ll1,
                             LatLonPoint ll2)

### getDescription

    public java.lang.String getDescription(java.lang.String coverageOrFeatureType)
                                    throws FormatException

  Given a string for a coverage type or feature type, return the description for that string. Return null if the code string isn't found.

  Parameters:
    `coverageOrFeatureType` - string ID for coverage or Feature type.
  Throws:
    `FormatException`

### main

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

  Just a test main to parse vpf datafiles param args files to parse, plus other command line flags

  Parameters:
    `args` - command line arguments args[0] is a path to the VPF root

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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