visad.data.gis
Class UsgsDemAdapter
- java.lang.Object
-
- visad.data.gis.UsgsDemAdapter
-
public class UsgsDemAdapter extends java.lang.ObjectUsgsDemAdapter converts the data in a USGS DEM file to a VisAD object. The specification for * the format can be found at http://rockyweb.cr.usgs.gov/nmpstds/acrodocs/dem/2DEM0198.PDF. Refer to this document for further explanation of the data elements of a DEM.To simplify things, class UsgsDem changes the format of a USGS 7.5 minute DEM to a simpler "row by column" raster form rather than the "row by column by subcolumn" format in the specification.
-
-
Constructor Summary
Constructors Constructor and Description UsgsDemAdapter()Default constructor, everything remains null.UsgsDemAdapter(java.lang.String filename)Constructs a new UsgsDemAdapter object with data read from the given (native format, non-SDTS) USGS DEM file
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description FieldImplgetData()Get the DEM as a VisAD data objectGridded2DSetgetDomain()Get the domain set for this DEMvoidload(java.lang.String filename)Reinitializes this UsgsDemAdapter object with data read from the given (non-SDTS) USGS DEM file.static voidmain(java.lang.String[] args)static java.lang.StringpadRight(java.lang.Object obj, int i)This method takes any Object and using its String representation provided by its toString() method, pads it with blank characters on the right, to a specified length.java.lang.StringtoString()Multi-line string representation
-
-
-
Constructor Detail
-
UsgsDemAdapter
public UsgsDemAdapter()
Default constructor, everything remains null. Call load() to load a file.
-
UsgsDemAdapter
public UsgsDemAdapter(java.lang.String filename) throws java.io.IOException, VisADExceptionConstructs a new UsgsDemAdapter object with data read from the given (native format, non-SDTS) USGS DEM file- Parameters:
filename- the name of the DEM file- Throws:
java.io.IOExceptionVisADException
-
-
Method Detail
-
load
public void load(java.lang.String filename) throws java.io.IOException, VisADExceptionReinitializes this UsgsDemAdapter object with data read from the given (non-SDTS) USGS DEM file.- Parameters:
filename- the name of the DEM file- Throws:
java.io.IOException- - If an I/O error occurs (invalid file)VisADException
-
toString
public java.lang.String toString()
Multi-line string representation- Overrides:
toStringin classjava.lang.Object- Returns:
- An info string suitable for printing to the console.
-
padRight
public static java.lang.String padRight(java.lang.Object obj, int i)This method takes any Object and using its String representation provided by its toString() method, pads it with blank characters on the right, to a specified length.- Parameters:
obj- Object to be paddedi- padding length
-
getData
public FieldImpl getData() throws VisADException
Get the DEM as a VisAD data object- Returns:
- a FlatField of type ((x,y) -> altitude) where x,y is either (Longitude, Latitude) or (EASTING, NORTHING)
- Throws:
VisADException
-
getDomain
public Gridded2DSet getDomain() throws VisADException
Get the domain set for this DEM- Returns:
- Gridded2DSet for domain
- Throws:
VisADException
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
DMelt 3.0 © DataMelt by jWork.ORG