Class LatLonLineReader

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

public class LatLonLineReader extends Object

The LatLonLineReader class reads sets of latitude/longitude locations to create line features and presents the data as a EarthDataOverlay object. If the lat/lon data contains out of range values (eg: -999), then the line data is broken up into multiple segments of continuous line data using the out of range locations as endpoints.

Since:
3.8.0
Author:
Peter Hollemans
  • Constructor Details

    • LatLonLineReader

      public LatLonLineReader(String filename) throws IOException
      Creates a new lat/lon line reader from data in a file.
      Parameters:
      filename - the filename for the lat/lon line file.
      Throws:
      IOException
  • Method Details

    • getOverlay

      public EarthDataOverlay getOverlay()
      Gets the overlay created from the line data.
      Returns:
      the overlay created from the lines read.
    • testLocationData

      public static void testLocationData(String filename) throws IOException
      Performs a test parsing of a list of latitude/longitude locations in a text file.
      Parameters:
      filename - the name of the text file to read.
      Throws:
      IOException - if an error occurred parsing the locations, or no valid locations were found.
    • readLocationData

      public static List<EarthLocation> readLocationData(String filename, Datum datum) throws IOException

      Reads a list of latitude/longitude locations in a text file, for example:

         30.0 -150.0
         31.0 -152.0
         ...
       

      Any locations with lat/lon values out of range are marked so that EarthLocation.isValid() returns false.

      Parameters:
      filename - the name of the text file to read.
      datum - the datum to use for creating the location points, or null to use WGS84.
      Returns:
      the list of points read.
      Throws:
      IOException - if an error occurred parsing the locations.
    • main

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception