edu.d.umn.fileformats
Class DemFile

java.lang.Object
  extended by edu.d.umn.fileformats.ElevationFile
      extended by edu.d.umn.fileformats.DemFile

public class DemFile
extends ElevationFile

This class is a specialization of the ElevationFile class created specifically to load DEM format data from the USGS archives.

See Also:
ElevationFile

Field Summary
static int ARECORD_LENGTH
          Length of the A record of a DEM file.
static int MIN_ARECORD_TOKENS
          Minimum number of A record tokens.
static int QUADRANGLE_NAME_LENGTH
          Name of the quadrangle the dem file describes.
 
Fields inherited from class edu.d.umn.fileformats.ElevationFile
elevations, fileName, filePath, groundCoordinates, maxElevation, minElevation, nColumns, nRows, quadrangleName, resolution
 
Constructor Summary
DemFile(java.lang.String aFileName)
          Create DemFile object from data contained in specified file
 
Method Summary
 double parseDemDouble(java.lang.String in)
          This method parses a double from a string.
 int parseDemInt(java.lang.String in)
          This method parses an integer from a string.
 
Methods inherited from class edu.d.umn.fileformats.ElevationFile
getResolution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARECORD_LENGTH

public static final int ARECORD_LENGTH
Length of the A record of a DEM file.

See Also:
Constant Field Values

QUADRANGLE_NAME_LENGTH

public static final int QUADRANGLE_NAME_LENGTH
Name of the quadrangle the dem file describes.

See Also:
Constant Field Values

MIN_ARECORD_TOKENS

public static final int MIN_ARECORD_TOKENS
Minimum number of A record tokens.

See Also:
Constant Field Values
Constructor Detail

DemFile

public DemFile(java.lang.String aFileName)
        throws java.lang.IllegalArgumentException
Create DemFile object from data contained in specified file

Parameters:
aFileName - name of the DEM file to load. File name should be a fully qualified file name.
Throws:
java.lang.IllegalArgumentException - Thrown if the file does not meet standards for a dem file.
Method Detail

parseDemDouble

public double parseDemDouble(java.lang.String in)
                      throws java.lang.NumberFormatException
This method parses a double from a string. Note, DEM data uses the old fortan notation for storing doubles using a 'D' intead of an 'E'.

Parameters:
in - string to parse
Returns:
double value from string
Throws:
java.lang.NumberFormatException - thrown when string is not a valid double

parseDemInt

public int parseDemInt(java.lang.String in)
                throws java.lang.NumberFormatException
This method parses an integer from a string. Note, DEM data uses the old fortan notation for storing doubles using a 'D' intead of an 'E'.

Parameters:
in - string to parse
Returns:
double value from string
Throws:
java.lang.NumberFormatException - thrown when string is not a valid double