Class BinnedGSHHSReaderFactory

java.lang.Object
noaa.coastwatch.render.feature.BinnedGSHHSReaderFactory

public class BinnedGSHHSReaderFactory extends Object
A BinnedGSHHSReaderFactory creates instances of BinnedGSHHSReader and BinnedGSHHSLineReader objects based on a resolution requirement.
Since:
3.2.1
Author:
Peter Hollemans
  • Field Details

    • FULL

      public static final int FULL
      Full resolution (less than 0.2 km).
      See Also:
    • HIGH

      public static final int HIGH
      High resolution (0.2 km) database level.
      See Also:
    • INTERMEDIATE

      public static final int INTERMEDIATE
      Intermediate resolution (1.0 km) database level.
      See Also:
    • LOW

      public static final int LOW
      Low resolution (5.0 km) database level.
      See Also:
    • CRUDE

      public static final int CRUDE
      Crude resolution (25 km) database level.
      See Also:
    • COAST

      public static final int COAST
      The coastline database type.
      See Also:
    • BORDER

      public static final int BORDER
      The border database type.
      See Also:
    • RIVER

      public static final int RIVER
      The riever database type.
      See Also:
  • Method Details

    • getInstance

      public static BinnedGSHHSReaderFactory getInstance()
      Gets an instance of this factory the uses local HDF files for reader data.
    • getInstance

      public static BinnedGSHHSReaderFactory getInstance(String serverPath)
      Gets an instance of this factory the uses the specified OPeNDAP server path for reader data.
      Parameters:
      serverPath - the full path to the OPeNDAP server and subdirectory, for example "http://server.com/data".
    • getDatabaseLevel

      public static int getDatabaseLevel(double resolution)
      Gets the reader database resolution level.
      Parameters:
      resolution - the pixel resolution in kilometers. The resolution determines the tolerance level used to decimate polygons from the full resolution database. Resolution values should reflect the desired accuracy of line rendering. For example, if the lines are to be rendered on an image where each pixel measures 5 km across, the lines (and possibly polygons) need not include features any smaller than 5 km. The resolution is used to determine the appropriate database name.
      Returns:
      the resolution level: FULL, HIGH, INTERMEDIATE, LOW, or CRUDE.
    • getDatabaseName

      public static String getDatabaseName(int type, int level)
      Gets a database name using its type and resolution level.
      Parameters:
      type - the database type: COAST, BORDER, or RIVER.
      level - the database resolution level: HIGH, INTERMEDIATE, LOW, or CRUDE.
      Returns:
      the name of the matching database.
    • getPolygonReader

      public BinnedGSHHSReader getPolygonReader(String name) throws IOException
      Gets an instance of the BinnedGSHHSReader class that uses the specified database. Only databases of type COAST are allowed.
      Parameters:
      name - the database name as returned from getDatabaseName(int, int).
      Returns:
      the reader object.
      Throws:
      IOException
    • getLineReader

      public BinnedGSHHSLineReader getLineReader(String name) throws IOException
      Gets an instance of a BinnedGSHHSLineReader object that uses the specified database. Only databases of type BORDER and RIVER are allowed.
      Parameters:
      name - the database name as returned from getDatabaseName(int, int).
      Returns:
      the reader object.
      Throws:
      IOException