visad.data.gis
Class DemFamily
- java.lang.Object
-
- visad.data.FormNode
-
- visad.data.FormFamily
-
- visad.data.FunctionFormFamily
-
- visad.data.gis.DemFamily
-
- All Implemented Interfaces:
- FormFileInformer
public class DemFamily extends FunctionFormFamily implements FormFileInformer
A container for all the supported DEM types. Currently, USGS DEM and Arc ASCIIGRID formats are supported. To read a Data object from a file or URL:
Data data = new DemFamily("dems").open(string);- See Also:
UsgsDemForm,ArcAsciiGridForm
-
-
Constructor Summary
Constructors Constructor and Description DemFamily(java.lang.String name)Construct a family of the supported map datatype FormsDemFamily(java.lang.String name, MathType dataFormat)Construct a family of the supported map datatype Forms
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static voidaddFormToList(FormNode form)Add to the family of the supported map datatype Formsjava.lang.String[]getDefaultSuffixes()Get a list of default suffixes for McIDAS map filesbooleanisThisType(byte[] block)Determines if this is a USGS DEM file from the starting blockbooleanisThisType(java.lang.String name)Determines if this is a DEM file from the namestatic voidmain(java.lang.String[] args)Test the DemFamily class run java visad.data.gis.DemFamily dem1 dem2 ...DataImplopen(java.lang.String id)Open a local data object using the first appropriate map form.DataImplopen(java.net.URL url)Open a remote data object using the first appropriate map form.-
Methods inherited from class visad.data.FunctionFormFamily
add, save
-
Methods inherited from class visad.data.FormFamily
addFormNode, getForms
-
-
-
-
Constructor Detail
-
DemFamily
public DemFamily(java.lang.String name)
Construct a family of the supported map datatype Forms- Parameters:
name- name of the family
-
DemFamily
public DemFamily(java.lang.String name, MathType dataFormat)Construct a family of the supported map datatype Forms- Parameters:
name- name of the family
-
-
Method Detail
-
addFormToList
public static void addFormToList(FormNode form) throws java.lang.ArrayIndexOutOfBoundsException
Add to the family of the supported map datatype Forms- Parameters:
form- FormNode to add to the list- Throws:
java.lang.ArrayIndexOutOfBoundsException- If there is no more room in the list.
-
isThisType
public boolean isThisType(java.lang.String name)
Determines if this is a DEM file from the name- Specified by:
isThisTypein interfaceFormFileInformer- Parameters:
name- name of the file- Returns:
- true if it matches the pattern for USGS DEM files
-
isThisType
public boolean isThisType(byte[] block)
Determines if this is a USGS DEM file from the starting block- Specified by:
isThisTypein interfaceFormFileInformer- Parameters:
block- block of data to check- Returns:
- false - there is no identifying block in a USGS DEM file
-
getDefaultSuffixes
public java.lang.String[] getDefaultSuffixes()
Get a list of default suffixes for McIDAS map files- Specified by:
getDefaultSuffixesin interfaceFormFileInformer- Returns:
- valid list of suffixes
-
open
public DataImpl open(java.lang.String id) throws BadFormException, VisADException
Open a local data object using the first appropriate map form.- Overrides:
openin classFunctionFormFamily- Parameters:
id- String representing the path of the map file- Throws:
BadFormException- - no form is appropriateVisADException- - VisAD error
-
open
public DataImpl open(java.net.URL url) throws BadFormException, VisADException, java.io.IOException
Open a remote data object using the first appropriate map form.- Overrides:
openin classFunctionFormFamily- Parameters:
url- URL representing the location of the map file- Throws:
BadFormException- - no form is appropriateVisADException- - VisAD errorjava.io.IOException- - file not found
-
main
public static void main(java.lang.String[] args) throws BadFormException, java.io.IOException, java.rmi.RemoteException, VisADExceptionTest the DemFamily class run java visad.data.gis.DemFamily dem1 dem2 ... demn- Throws:
BadFormExceptionjava.io.IOExceptionjava.rmi.RemoteExceptionVisADException
-
-
DMelt 3.0 © DataMelt by jWork.ORG