Class NavigationPointWriter

java.lang.Object
noaa.coastwatch.gui.nav.NavigationPointWriter
Direct Known Subclasses:
CSVPointWriter, XMLPointWriter

public abstract class NavigationPointWriter extends Object
The NavigationPointWriter class is an abstract class for writing out data from a list of navigation points.
Since:
3.2.2
Author:
Peter Hollemans
  • Field Details

    • reader

      protected EarthDataReader reader
      The reader to get extra data from.
    • variableList

      protected List<String> variableList
      The list of variables to access in the reader.
    • gridCache

      protected Map<String,Grid> gridCache
      The cache of grid variables.
  • Constructor Details

    • NavigationPointWriter

      protected NavigationPointWriter(EarthDataReader reader, List<String> variableList, List<NavigationPoint> pointList) throws IOException
      Creates a point writer.
      Parameters:
      reader - the reader to use for extra data to write with each point.
      variableList - the list of variables from the reader to use for writing variable data at each point.
      pointList - the list of navigation points to write.
      Throws:
      IOException - if an error occurred accessing a data variable from the list.
  • Method Details

    • getNorth

      public double[] getNorth(DataLocation dataLoc)
      Gets the data location north vector.
      Parameters:
      dataLoc - the data location to query.
      Returns:
      the unit vector in the direction of north as [row, col].
    • writeHeader

      protected abstract void writeHeader(PrintStream stream)
      Writes the file header to the stream.
      Parameters:
      stream - the print stream to write to.
    • writePoint

      protected abstract void writePoint(PrintStream stream, NavigationPoint point)
      Writes a single point to the stream.
      Parameters:
      stream - the print stream to write to.
      point - the navigation point to write.
    • writeFooter

      protected abstract void writeFooter(PrintStream stream)
      Writes the file footer to the stream.
      Parameters:
      stream - the print stream to write to.
    • write

      public void write(OutputStream stream)
      Writes the point data.
      Parameters:
      stream - the output stream to write to.
    • getTestPoints

      protected static List<NavigationPoint> getTestPoints(EarthTransform trans, int count)
      Provides test data for this class.
      Parameters:
      trans - the earth transform to generate test data for.
      count - the number of test data points desired.
      Returns:
      the list of test data points. Each point will has a randomly generated earth location and navigation offset. The comments in the point summarize the point data.