|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjecthydroScalingAPI.io.MetaRaster
public class MetaRaster
This class reads a *.metaDEM or *.metaVHC and creates an object that descibes an associated binary files.
| Constructor Summary | |
|---|---|
MetaRaster()
Creates an empty MetaRaster instance |
|
MetaRaster(java.io.File file)
Creates a MetaRaster instance using the information on a file. |
|
MetaRaster(MetaRaster mr)
Creates new MetaRaster using another metaRaster as a template |
|
| Method Summary | |
|---|---|
java.util.Hashtable |
cloneProperties()
clones the Hashtable that contains the MetaRaster properties |
float[][] |
getArray()
Returns a float[][] array with the infomation contained in the binary file |
java.util.Hashtable |
getCategoriesTable()
Returns the Hashtable of categories for this variable |
java.lang.String |
getCategory(java.lang.String catToFind)
Returns the lable associated to a category type |
visad.FlatField |
getField()
Returns visad.FlatField appropriate for a visad.Display |
java.lang.String |
getFormat()
Returns the value associated to the [Format] tag |
java.io.File |
getLocationBinaryFile()
Returns a java.io.File object pointing to the location of the binary file described by this MetaRaster |
java.io.File |
getLocationMeta()
Returns a java.io.File object pointing to the location of the meta file |
double |
getMaxLat()
Calculates and returns the maximum latitude |
double |
getMaxLon()
Calculates and returns the maximum longitude |
double |
getMinLat()
Returns the value associated to the [Southernmost Latitude] tag. |
double |
getMinLon()
Returns the value associated to the [Westernmost Longitude] tag. |
java.lang.String |
getMissing()
Returns the value associated to the [Missing] tag |
java.lang.String |
getName()
Returns the value associated to the [Name] tag |
int |
getNumCols()
Returns the value associated to the [# Columns] tag |
int |
getNumRows()
Returns the value associated to the [# Rows] tag |
java.lang.String |
getProperty(java.lang.String prop)
Returs the value of a property of the MetaRaster. |
double |
getResLat()
Returns the value associated to the [Latitudinal Resolution (ArcSec)] tag |
double |
getResLon()
Returns the value associated to the [Longitudinal Resolution (ArcSec)] tag |
int |
getTemporalScale()
Returns the value associated to the [Temporal Resolution] tag in milliseconds or -1 if "fix" |
java.lang.String |
getUnits()
Returns the value associated to the [Units] tag |
static void |
main(java.lang.String[] args)
Tests for the class |
void |
restoreOriginalFormat()
Restores the value of the [Format] tag to its original value if it has been modified using the setFormat(String format) method |
void |
setFormat(java.lang.String newFormat)
Sets the value for the [Format] tag |
void |
setInformation(java.lang.String newInformation)
Sets the value of the [Information] tag |
void |
setLocationBinaryFile(java.io.File file)
Sets the path of the binary file assicitated with the information of the MetaRaster. |
void |
setLocationMeta(java.io.File file)
Sets the path where the metaFile resides. |
void |
setMinLat(java.lang.String newMinLat)
Sets the value for the [Southernmost Latitude] tag |
void |
setMinLon(java.lang.String newMinLon)
Sets the value for the [Westernmost Longitude] tag |
void |
setMissing(java.lang.String newMissinng)
Sets the value for the [Missing] tag |
void |
setName(java.lang.String newName)
Sets the value for the [Name] tag |
void |
setNumCols(int newNumCols)
Sets the value for the [# Columns] tag |
void |
setNumRows(int newNumRows)
Sets the value for the [# Rows] tag |
void |
setResLat(double newResLat)
Sets the value for the [Latitudinal Resolution (ArcSec)] tag |
void |
setResLon(double newResLon)
Sets the value for the [Longitudinal Resolution (ArcSec)] tag |
void |
setTemporalScale(java.lang.String tempScale)
Sets the value for the [Temporal Resolution] tag |
void |
setUnits(java.lang.String newUnits)
Sets the value of the [Units] tag |
java.lang.String |
toString()
Creates a String that describes the information in the meta file |
void |
writeMetaRaster(java.io.File newMetaLocation)
Writes the information in the MetaRaster to the specified path |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MetaRaster(MetaRaster mr)
mr - The MetaRaster to be used as templatepublic MetaRaster()
public MetaRaster(java.io.File file)
throws java.io.IOException
file - The file that contains the information that describes associated binary files
java.io.IOException - Captures errors while reading the meta file| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void setLocationMeta(java.io.File file)
file - The file where the meta file residespublic void setLocationBinaryFile(java.io.File file)
file - The path to the binary filepublic void setName(java.lang.String newName)
newName - The new name to assign to the informationpublic void setMinLat(java.lang.String newMinLat)
newMinLat - A properly formated string DD:MM:SS.SS [N/S]. See DegreesToDMS
for a static methods format geographic position descriptors.public void setMinLon(java.lang.String newMinLon)
newMinLon - A properly formated string DD:MM:SS.SS [N/S]. See DegreesToDMS
for a static methods format geographic position descriptors.public void setResLat(double newResLat)
newResLat - A double precision number indicating the Latitudinal resolution (vertical pixel
size) in ArcSecondspublic void setResLon(double newResLon)
newResLon - A double precision number indicating the Longitudinal resolution (vertical pixel
size) in ArcSecondspublic void setNumCols(int newNumCols)
newNumCols - A integer indicating the number of Columns in the raster binary filepublic void setNumRows(int newNumRows)
newNumRows - A integer indicating the number of Rows in the raster binary filepublic void setFormat(java.lang.String newFormat)
newFormat - A String indicating the format of the raster binary file. Available formats
are: Byte, Integer, Float and Double.public void setMissing(java.lang.String newMissinng)
newMissinng - A number indicating missing information in the binary filepublic void restoreOriginalFormat()
public void setTemporalScale(java.lang.String tempScale)
tempScale - A string describing the temporal resolution. It can be Fix for spatial
variables with no temporal variability (e.g. a digital elevation model) or a
number followed by a time descriptor (e.g. 1-minute, 20-hours, 1-year, etc)public void setUnits(java.lang.String newUnits)
newUnits - A string describing the units of the informationpublic void setInformation(java.lang.String newInformation)
newInformation - A string describing the informationpublic java.io.File getLocationMeta()
public java.io.File getLocationBinaryFile()
public java.lang.String getProperty(java.lang.String prop)
[Name]
[Southernmost Latitude]
[Westernmost Longitude]
[Longitudinal Resolution (ArcSec)]
[Latitudinal Resolution (ArcSec)]
[# Columns][# Rows]
[Format]
[Missing]
[Temporal Resolution]
[Units]
[Information]
prop - The tag of the desired property
public java.lang.String getMissing()
public java.lang.String getFormat()
public java.lang.String getUnits()
public java.lang.String getCategory(java.lang.String catToFind)
catToFind - The category to find
public java.util.Hashtable getCategoriesTable()
public int getNumRows()
public int getNumCols()
public double getMinLat()
DMSToDegrees static method
public double getMinLon()
DMSToDegrees static method
public double getResLat()
public double getResLon()
public double getMaxLat()
public double getMaxLon()
public java.lang.String getName()
public int getTemporalScale()
public float[][] getArray()
throws java.io.IOException
java.io.IOException - Captures errors while reading the binary file
public visad.FlatField getField()
throws visad.VisADException,
java.io.IOException
visad.VisADException - Captures errors while creating the visad Data object
java.io.IOException - Captures errors while reading the information
public void writeMetaRaster(java.io.File newMetaLocation)
throws java.io.IOException
newMetaLocation - The path where the metafile must be writen
java.io.IOException - Captures errors while writing the informationpublic java.util.Hashtable cloneProperties()
Hashtable that contains the MetaRaster properties
Hashtablepublic static void main(java.lang.String[] args)
args - Command line arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
CUENCAS was initially developed by Ricardo Mantilla at the University of Colorado under the supervision of Dr. Vijay K. Gupta. We wish to recognize the support from the National Science Fundation.