Package noaa.coastwatch.gui.nav
Class NavigationPointWriter
java.lang.Object
noaa.coastwatch.gui.nav.NavigationPointWriter
- Direct Known Subclasses:
CSVPointWriter
,XMLPointWriter
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 Summary
Modifier and TypeFieldDescriptionThe cache of grid variables.protected EarthDataReader
The reader to get extra data from.The list of variables to access in the reader. -
Constructor Summary
ModifierConstructorDescriptionprotected
NavigationPointWriter
(EarthDataReader reader, List<String> variableList, List<NavigationPoint> pointList) Creates a point writer. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getNorth
(DataLocation dataLoc) Gets the data location north vector.protected static List<NavigationPoint>
getTestPoints
(EarthTransform trans, int count) Provides test data for this class.void
write
(OutputStream stream) Writes the point data.protected abstract void
writeFooter
(PrintStream stream) Writes the file footer to the stream.protected abstract void
writeHeader
(PrintStream stream) Writes the file header to the stream.protected abstract void
writePoint
(PrintStream stream, NavigationPoint point) Writes a single point to the stream.
-
Field Details
-
reader
The reader to get extra data from. -
variableList
The list of variables to access in the reader. -
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
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
Writes the file header to the stream.- Parameters:
stream
- the print stream to write to.
-
write
Writes the point data.- Parameters:
stream
- the output stream to write to.
-
getTestPoints
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.
-