com.c5corp.DEMconvert.filters
Class Dem2C51KGrid

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

public final class Dem2C51KGrid
extends C5DemAbstractFilter
implements C5DemConstants

Dem2C51KGrid.java - part of C5 Landscape (C5UTM) database

Dem2C51KGrid is a C5 DEM Tool filter that processes a dem to update the C5UTM database, using java JDBC, and produce image files.

Dem2C51KGrid adds data to the C5UTM db UTM_1K_GRID_DATA and UTM_POINT_STATS tables, copying data from a dem file directly into the database, and producing related images that are written to the specified web image directory. See the C5UTMconfs class.

The purpose of this filter is to preprocess into the database as much data as is possible directly from the dem files, which is faster than getting the same data back out of the database's UTM_COORD table, thus helping to build the UTM_1K_GRID_DATA and UTM_POINT_STATS tables in more reasonable time.

Once run over a dem, this filter will set the DEM_METADATA.1K_grid attribute to level 1, or "partially processed". Level one indicates that the dem's complete 1K areas (at multiples of 1000 in the UTM grid) have been processed.

This filter can be executed as a batch over all available dems via the com.c5corp.c5utm.util.Build1KGridFromFiles class (main method). The com.c5corp.c5utm.util.Build1KGridFromDb utility should be used to process the the overlaping areas shared between dems. (1K areas with points in adjacent dems). This filter does not interpolate 10 meter data to 30 meter data, thus those dems originally in 10 meter format must be fully processed with Build1KGridFromDb.

The com.c5corp.c5utm.util.Build1KGridStats utility will execute these utilities wisely, using the DEM_METADATA.1K_grid as a guide.

Refer to sql directory for info on the data model.

Since:
1.0.3
Author:
Brett Stalbaum Copyright 2002-2006 see LICENSE.txt and UCSD_LICENSE.txt
See Also:
Build1KGridFromFiles, Build1KGridFromDb, Build1KGridStats, C5UTMconfs

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
Dem2C51KGrid()
          Default constuctor, required by the newInstance() method of the Class class, such that this class can be dynamically loaded.
Dem2C51KGrid(java.lang.String filename)
          Builds tables from the specified file name.
 
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 method for command line usage
 void setOutputPath(java.lang.String path)
          sets the path to the output file
 java.lang.String toString()
          overrides java.lang.Object.toString()
 void writeData(Dem dem, java.io.PrintWriter out)
          A method to write the output data to the (database).
 void writeHeader(Dem dem, java.io.PrintWriter out)
          A method for output of metadata
 
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

Dem2C51KGrid

public Dem2C51KGrid()
Default constuctor, required by the newInstance() method of the Class class, such that this class can be dynamically loaded.


Dem2C51KGrid

public Dem2C51KGrid(java.lang.String filename)
Builds tables from the specified file name. Can be invoked from the command line.

Parameters:
filename - the file name
Method Detail

main

public static void main(java.lang.String[] args)
the main method for command line usage

Parameters:
args - usage issue: -i input file must be .dem

writeHeader

public void writeHeader(Dem dem,
                        java.io.PrintWriter out)
Description copied from class: C5DemAbstractFilter
A method for output of metadata

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

writeData

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

Specified by:
writeData in class C5DemAbstractFilter
Parameters:
dem - A Dem.
out - 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

setOutputPath

public void setOutputPath(java.lang.String path)
sets the path to the output file

Parameters:
path - path to output directory

toString

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

Overrides:
toString in class C5DemAbstractFilter