com.c5corp.DEMconvert.filters
Class Corpscon10To30Meter

java.lang.Object
  extended by com.c5corp.DEMconvert.C5DemAbstractFilter
      extended by com.c5corp.DEMconvert.filters.Corpscon10To30Meter
All Implemented Interfaces:
C5DemConstants

public final class Corpscon10To30Meter
extends C5DemAbstractFilter

Converts a DEM file into a corpscon/C5UTM batch file with 10 meter to 30 meter downsampling also functions as an filter in DemTool. Converts the elevations in a DEM into a corpscon batch file includes corner cordinates in the first 4 data field for conversion by corpscon and insertion into C5UTM db. This filter expects a DEM directory in the pwd Also converts meters to feet.

Since:
1.0

Current USGS DEM data typically contains data cast on the North American Horizontal Datum of 1927, (NAD27), and the vertical datum NGVD29. Some of the newer data is NAD83.

The US army corps of engineers makes a dos/win program called CORPSCON (which encapsulates NADCON from noaa for its horizontal conversions), that converts between various horizontal and vertical datum. This class exports DEM data into a CORPCON batch file to preform such conversions.

CORPSCON is available at: http://crunch.tec.army.mil/software/corpscon/corpscon.html

Thank you to the corps of engineers and noaa.

The following is from the Corpswin.doc (CORPSCON documentation), about the file format for UTM grid coords:

For grid coordinates, the fields are:

  1. Point Name
  2. Easting or X value
  3. Northing or Y value
  4. Elevation (optional)

Again, the fourth field is required only if vertical conversions are to be performed. Below are some examples of valid lines for grid coordinates:

Point A, 500000.0, 2600000.0, 1238.4566
, 500010, 2600400.264, 10.66
PTC, 512353.23523,2600234.23453, 100.6

Lines beginning with a ';' or '#' characters in Corpscon Batch Files are interpreted as comment lines.

Author:
Brett Stalbaum Copyright 2002-2006 see LICENSE.txt and UCSD_LICENSE.txt

Field Summary
 
Fields inherited from interface com.c5corp.c5dem.C5DemConstants
copy, E_BIT, FEETTOMETERS, hdatum, METERSTOFEET, N_BIT, NE_BIT, NW_BIT, S_BIT, SE_BIT, SW_BIT, system, units, vdatum, W_BIT
 
Constructor Summary
Corpscon10To30Meter()
          the default constructor creates a blank object such that writeHeader(Dem, PrintWriter) and writeData(Dem, Printwriter) can be used with arbitrary Dem and PrintWriter objects
Corpscon10To30Meter(java.lang.String in_filename)
          This constructor is used by the main function in this class, which is intended mostly for command line use.
 
Method Summary
 java.lang.String getFilterInfo()
          A method that returns a string containing information about the filter.
 java.lang.String getOutputPath()
          Returns a relative path describing the location of the output.
static void main(java.lang.String[] args)
          The main function is maintained so that this filter can be used from the command line, in addition to being used inside of c5 dem tool
 java.lang.String toString()
          overrides java.lang.Object.toString()
 void writeData(Dem dem, java.io.PrintWriter theout)
          A method to write the output (formated) data to the file.
 void writeHeader(Dem dem, java.io.PrintWriter theout)
          A method for output of metadata to the file (overrides C5DemAbstractFilter) system[], units[], vdatum[] and hdatum[] are from C5DemConstants interface.
 
Methods inherited from class com.c5corp.DEMconvert.C5DemAbstractFilter
openOutputFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Corpscon10To30Meter

public Corpscon10To30Meter()
the default constructor creates a blank object such that writeHeader(Dem, PrintWriter) and writeData(Dem, Printwriter) can be used with arbitrary Dem and PrintWriter objects


Corpscon10To30Meter

public Corpscon10To30Meter(java.lang.String in_filename)
This constructor is used by the main function in this class, which is intended mostly for command line use.

Parameters:
in_filename - the name of the input file
Method Detail

main

public static void main(java.lang.String[] args)
The main function is maintained so that this filter can be used from the command line, in addition to being used inside of c5 dem tool

Parameters:
args - the corpscon file

writeHeader

public void writeHeader(Dem dem,
                        java.io.PrintWriter theout)
A method for output of metadata to the file (overrides C5DemAbstractFilter) system[], units[], vdatum[] and hdatum[] are from C5DemConstants interface.

Specified by:
writeHeader in class C5DemAbstractFilter
Parameters:
dem - A Dem.
theout - Where to write the data.
See Also:
C5DemConstants

writeData

public void writeData(Dem dem,
                      java.io.PrintWriter theout)
A method to write the output (formated) data to the file. (overrides C5DemAbstractFilter)

Specified by:
writeData in class C5DemAbstractFilter
Parameters:
dem - A Dem.
theout - Where to write the data.

getFilterInfo

public java.lang.String getFilterInfo()
A method that returns a string containing information about the filter.

Specified by:
getFilterInfo in class C5DemAbstractFilter
Returns:
the string info about the filter

getOutputPath

public java.lang.String getOutputPath()
Returns a relative path describing the location of the output.

Overrides:
getOutputPath in class C5DemAbstractFilter
Returns:
the output file path

toString

public java.lang.String toString()
overrides java.lang.Object.toString()

Overrides:
toString in class C5DemAbstractFilter