Class OpendapGSHHSReader

All Implemented Interfaces:
Iterable<Feature>, FeatureSource

public class OpendapGSHHSReader extends BinnedGSHHSReader
The OpendapGSHHSReader extends BinnedGSHHSReader to read data from an OPeNDAP-enabled binned data file. Some optimizations are made for network connections.
Since:
3.2.1
Author:
Peter Hollemans
  • Constructor Details

    • OpendapGSHHSReader

      public OpendapGSHHSReader(String path, String name) throws IOException
      Creates a new binned GSHHS reader from the database name. By default, there is no minimum area for polygon selection and no polygons are selected.
      Parameters:
      path - the OPeNDAP server path as http://server/path.
      name - the database name. Several predefined database names are available from BinnedGSHHSReaderFactory.getDatabaseName(int, int).
      Throws:
      IOException - if an error occurred reading the file.
  • Method Details

    • setBinHint

      protected void setBinHint(int index)
      Description copied from class: BinnedGSHHSReader
      Sets a hint that subsequent bin data access is about to occur. This may be used by child classes to increase the speed of bin data access.
      Overrides:
      setBinHint in class BinnedGSHHSReader
      Parameters:
      index - the bin that data access will be performed for next.
    • readData

      protected void readData(int sdsid, int[] start, int[] count, Object data) throws IOException
      Description copied from class: BinnedGSHHSReader
      Reads data for the specified variable ID.
      Specified by:
      readData in class BinnedGSHHSReader
      Parameters:
      sdsid - the identifier for the variable.
      start - the starting data index for reading.
      count - the number of data values to read.
      data - the data array to fill with values.
      Throws:
      IOException - if an error occurred reading the data.
    • readData

      protected void readData(String var, int[] start, int[] count, Object data) throws IOException
      Description copied from class: BinnedGSHHSReader
      Reads data for the specified variable name.
      Specified by:
      readData in class BinnedGSHHSReader
      Parameters:
      var - the name of the variable.
      start - the starting data index for reading.
      count - the number of data values to read.
      data - the data array to fill with values.
      Throws:
      IOException - if an error occurred reading the data.
    • setBinListHint

      protected void setBinListHint(List indexList)
      Description copied from class: BinnedGSHHSReader
      Sets a hint that subsequent bin data access is about to occur for a list of bins. This may be used by child classes to increase the speed of bin data access.
      Overrides:
      setBinListHint in class BinnedGSHHSReader
      Parameters:
      indexList - the list of bin indices to be accessed sorted in increasing order.
    • selectData

      protected int selectData(String var) throws IOException
      Description copied from class: BinnedGSHHSReader
      Gets the variable ID for the specified variable.
      Specified by:
      selectData in class BinnedGSHHSReader
      Parameters:
      var - the variable name to retrieve an ID.
      Returns:
      the variable ID.
      Throws:
      IOException - if an error occurred retrieving the ID.
    • openFile

      protected int openFile(String name) throws IOException
      Description copied from class: BinnedGSHHSReader
      Opens the data file and returns the file ID.
      Specified by:
      openFile in class BinnedGSHHSReader
      Parameters:
      name - the data file name.
      Throws:
      IOException - if an error occurred opening the file.
    • getGlobalData

      protected void getGlobalData() throws IOException
      Description copied from class: BinnedGSHHSReader
      Reads data about the entire file, including binSize, multiplier, lonBins, latBins, totalBins, firstSegment, numSegments, binInfo, and segmentStart.
      Specified by:
      getGlobalData in class BinnedGSHHSReader
      Throws:
      IOException - if an error occurred reading the data.