hydroScalingAPI.io
Class CRasToGrass

java.lang.Object
  extended by hydroScalingAPI.io.CRasToGrass

public class CRasToGrass
extends java.lang.Object

This class takes a CUENCAS raster and creates a GRASS ascii raster inputFile, which can be a DEM or a hydrometeorological field. IMPORTANT: The Class will write the GRID inputFile using a gloabal LAT-LONG WGS-84 projection.

Author:
Ricardo Mantilla

Constructor Summary
CRasToGrass(java.io.File inputFile, java.io.File outputDir)
          Creates a new instance of CRasToGrass
 
Method Summary
 void fileToExport(java.io.File inputFile)
          Provides the class with the path to the binary file to be exported using the data from the MetaRaster provided in the constructor
 void fileToExport(MetaRaster thisMetaInfo)
          Takes in a new MetaRaster to use as template for the data to be exported
static void main(java.lang.String[] args)
          Tests for the class
 void writeGrassFile()
          Writes the data in GRASS ascii format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRasToGrass

public CRasToGrass(java.io.File inputFile,
                   java.io.File outputDir)
            throws java.io.IOException
Creates a new instance of CRasToGrass

Parameters:
inputFile - The MetaRaster for the file to be exported
outputDir - The destination directory
Throws:
java.io.IOException - Captures error in the read/write process
Method Detail

fileToExport

public void fileToExport(java.io.File inputFile)
                  throws java.io.IOException
Provides the class with the path to the binary file to be exported using the data from the MetaRaster provided in the constructor

Parameters:
inputFile - Path to the binary file
Throws:
java.io.IOException - Captures errors reading and/or writing

fileToExport

public void fileToExport(MetaRaster thisMetaInfo)
                  throws java.io.IOException
Takes in a new MetaRaster to use as template for the data to be exported

Parameters:
thisMetaInfo - The MetaRaster that will be used to retrive binary data
Throws:
java.io.IOException - Errors reading the data

writeGrassFile

public void writeGrassFile()
                    throws java.io.IOException
Writes the data in GRASS ascii format

Throws:
java.io.IOException - Captures errors while writing the ascii file

main

public static void main(java.lang.String[] args)
Tests for the class

Parameters:
args - the command line arguments


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.