visad.data.gis
Class ArcAsciiGridAdapter
- java.lang.Object
-
- visad.data.gis.ArcAsciiGridAdapter
-
public class ArcAsciiGridAdapter extends java.lang.ObjectAsciiArcGridAdapter converts an ASCII ArcGrid file into a VisAD Data object.
-
-
Field Summary
Fields Modifier and Type Field and Description static RealTypeDEFAULT_DATA_TYPEDefault data typestatic RealTupleTypeDEFAULT_SPATIAL_TYPEDefault spatial type
-
Constructor Summary
Constructors Constructor and Description ArcAsciiGridAdapter(java.lang.String filename)Create an ArcAsciiGridAdapter for the particular file.ArcAsciiGridAdapter(java.lang.String filename, RealTupleType spatialType)Create an ArcAsciiGridAdapter for the particular file and use the RealType specified for the data metadata.ArcAsciiGridAdapter(java.lang.String filename, RealTupleType spatialType, RealType dataType)Create an ArcAsciiGridAdapter for the particular file and use the RealType specified for the data metadata.ArcAsciiGridAdapter(java.lang.String filename, RealTupleType spatialType, RealType dataType, Unit dataUnit)Create an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.ArcAsciiGridAdapter(java.lang.String filename, RealType dataType)Create an ArcAsciiGridAdapter for the particular file and use the RealType specified for the data metadata.ArcAsciiGridAdapter(java.lang.String filename, RealType dataType, Unit dataUnit)Create an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.ArcAsciiGridAdapter(java.lang.String filename, java.lang.String dataName)Create an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.ArcAsciiGridAdapter(java.lang.String filename, java.lang.String dataName, java.lang.String unitSpec)Create an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.ArcAsciiGridAdapter(java.lang.String filename, Unit dataUnit)Create an ArcAsciiGridAdapter for the particular file and use units specified for the data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description java.awt.geom.Rectangle2DgetBounds()Get the bounds of this gridfloatgetCellSize()Deprecated.Use getCellSizeX and getCellSizeYfloatgetCellSizeX()Get the cell size of this gridfloatgetCellSizeY()Get the cell size of this gridintgetColumns()Get the number of columns in this gridFieldImplgetData()Get the ASCIIGRID as a VisAD data objectFieldImplgetData(MathType mathType)Get the ASCIIGRID as a VisAD data object with the specified domain and range.FieldImplgetData(RealTupleType spatialType, RealType dataType)Get the ASCIIGRID as a VisAD data object with the specified spatial domain and range.RealTypegetDataType()Get the type of the Data.UnitgetDataUnit()Get the data unitsfloatgetNoDataValue()Get the missing data value for this gridintgetRows()Get the number of rows in this gridGridded2DSetgetSpatialSet()Get the domain set for this DEM as a Longitude, Latitude setGridded2DSetgetSpatialSet(RealTupleType spatialType)Get the spatial domain set for this ASCIIGRID with the specified type.RealTupleTypegetSpatialType()Get the spatial domain type.floatgetXLLCorner()Get the x value of the lower left corner of the grid.floatgetYLLCorner()Get the y value of the lower left corner of the grid.static voidmain(java.lang.String[] args)test this class "java visad.data.gis.ArcAsciiGridAdpater" voidsetDataType(RealType newType)Set the range type.voidsetDataUnit(Unit newUnit)Set the data unitsvoidsetSpatialType(RealTupleType newSpatialType)Set the spatial domain type.java.lang.StringtoString()Return a string representation of this grid as constructed.
-
-
-
Field Detail
-
DEFAULT_SPATIAL_TYPE
public static final RealTupleType DEFAULT_SPATIAL_TYPE
Default spatial type
-
DEFAULT_DATA_TYPE
public static final RealType DEFAULT_DATA_TYPE
Default data type
-
-
Constructor Detail
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file. Data are assumed to be elevation values in meters- Parameters:
filename- name of file to read- Throws:
VisADException- couldn't create VisAD object
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, RealType dataType) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use the RealType specified for the data metadata. Data are assumed to be in the default units of the RealType.- Parameters:
filename- name of file to readdataType- RealType to use for range units- Throws:
VisADException- couldn't create VisAD object
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, RealTupleType spatialType) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use the RealType specified for the data metadata. Data are assumed to be in the default units of the RealType.- Parameters:
filename- name of file to readspatialType- RealTupleType to use for spatial domain- Throws:
VisADException- couldn't create VisAD object
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, RealTupleType spatialType, RealType dataType) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use the RealType specified for the data metadata. Data are assumed to be in the default units of the RealType.- Parameters:
filename- name of file to readspatialType- RealTupleType to use for the spatial domain.dataType- RealType to use for range units- Throws:
VisADException- couldn't create VisAD object
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, Unit dataUnit) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use units specified for the data. Data are assumed to be altitudes.- Parameters:
filename- name of file to readdataUnit- Unit of data- Throws:
VisADException- if unit is incompatible
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, java.lang.String dataName) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.- Parameters:
filename- name of file to readdataName- name to use for creating RealType- Throws:
VisADException- if unit is incompatible, or problem with file
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, java.lang.String dataName, java.lang.String unitSpec) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.- Parameters:
filename- name of file to readdataName- name for the dataunitSpec- valid Unit specification- Throws:
VisADException- if unit is incompatible, or problem with file
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, RealType dataType, Unit dataUnit) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.- Parameters:
filename- name of file to readdataType- RealType to use for range unitsdataUnit- Unit of data if different fromdataTypedefault units.- Throws:
VisADException- if unit is incompatible, or problem with file
-
ArcAsciiGridAdapter
public ArcAsciiGridAdapter(java.lang.String filename, RealTupleType spatialType, RealType dataType, Unit dataUnit) throws VisADExceptionCreate an ArcAsciiGridAdapter for the particular file and use the supplied RealType for the data values, and units if different from default from RealType.- Parameters:
filename- name of file to readspatialType- RealTupleType to use for the spatial domain.dataType- RealType to use for range unitsdataUnit- Unit of data if different fromdataTypedefault units.- Throws:
VisADException- if unit is incompatible, or problem with file
-
-
Method Detail
-
getData
public FieldImpl getData() throws VisADException
Get the ASCIIGRID as a VisAD data object- Returns:
- a FlatField of type ((getSpatialType()) -> getDataType())
- Throws:
VisADException
-
getData
public FieldImpl getData(RealTupleType spatialType, RealType dataType) throws VisADException
Get the ASCIIGRID as a VisAD data object with the specified spatial domain and range.- Parameters:
spatialType- type for spatial domaindataType- type for range- Returns:
- a FlatField of type ((spatialType) -> dataType)
- Throws:
VisADException
-
getData
public FieldImpl getData(MathType mathType) throws VisADException
Get the ASCIIGRID as a VisAD data object with the specified domain and range.- Parameters:
mathType- type to use. If it's a FunctionType, it defines the return objects function type. If it's a RealTupleType, it defines the domain type, if it's a RealType, it defines the data type.- Returns:
- a FlatField based on
mathType - Throws:
VisADException
-
getSpatialSet
public Gridded2DSet getSpatialSet() throws VisADException
Get the domain set for this DEM as a Longitude, Latitude set- Returns:
- Gridded2DSet for domain
- Throws:
VisADException
-
getSpatialSet
public Gridded2DSet getSpatialSet(RealTupleType spatialType) throws VisADException
Get the spatial domain set for this ASCIIGRID with the specified type.- Parameters:
spatialType- RealTupleType (dimension 2) to use for this domain- Returns:
- Gridded2DSet for spatial domain
- Throws:
VisADException
-
getXLLCorner
public float getXLLCorner()
Get the x value of the lower left corner of the grid.- Returns:
- x value of lower left corner.
-
getYLLCorner
public float getYLLCorner()
Get the y value of the lower left corner of the grid.- Returns:
- y value of lower left corner.
-
getCellSize
public float getCellSize()
Deprecated. Use getCellSizeX and getCellSizeYGet the cell size of this grid- Returns:
- cell size
-
getCellSizeX
public float getCellSizeX()
Get the cell size of this grid- Returns:
- cell size
-
getCellSizeY
public float getCellSizeY()
Get the cell size of this grid- Returns:
- cell size
-
getNoDataValue
public float getNoDataValue()
Get the missing data value for this grid- Returns:
- missing data value (or NaN if not specified)
-
getRows
public int getRows()
Get the number of rows in this grid- Returns:
- number of rows
-
getColumns
public int getColumns()
Get the number of columns in this grid- Returns:
- number of columns
-
getSpatialType
public RealTupleType getSpatialType()
Get the spatial domain type.- Returns:
- type of the spatial set.
-
setSpatialType
public void setSpatialType(RealTupleType newSpatialType)
Set the spatial domain type.- Parameters:
newSpatialType- new type for
-
setDataType
public void setDataType(RealType newType)
Set the range type.- Parameters:
newType- new type for range
-
getDataType
public RealType getDataType()
Get the type of the Data.- Returns:
- type of the data
-
setDataUnit
public void setDataUnit(Unit newUnit)
Set the data units- Parameters:
newUnit- new units for data
-
getDataUnit
public Unit getDataUnit()
Get the data units- Returns:
- units of the data
-
getBounds
public java.awt.geom.Rectangle2D getBounds()
Get the bounds of this grid- Returns:
- bounds as a rectangle.
-
toString
public java.lang.String toString()
Return a string representation of this grid as constructed.- Overrides:
toStringin classjava.lang.Object- Returns:
- String representation:
-
main
public static void main(java.lang.String[] args) throws java.lang.Exceptiontest this class "java visad.data.gis.ArcAsciiGridAdpater" - Throws:
java.lang.Exception
-
-
DMelt 3.0 © DataMelt by jWork.ORG