com.c5corp.c5dem
Class DemTable

java.lang.Object
  extended by com.c5corp.c5dem.Dem
      extended by com.c5corp.c5dem.DemTable

public class DemTable
extends Dem

Extention of com.c5corp.c5dem.Dem adding a table of UtmCoordinatePairElev objects describing xy coordinates for a Dem. Interpolates UTM coordinates over a java image compatible 2D array of UtmCoordinatePairElev objects, with null values for points not repesented in the DEM grid).

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

Constructor Summary
DemTable(java.io.File file)
          Constructs a DEM from an input file specified in java.io.File file
DemTable(java.lang.String inputfile)
          Constructs a DEM from an input file specified in String inputfile
DemTable(java.net.URL url)
          Constructs a DEM from a java.net.URL
 
Method Summary
 double averageDemElevation()
          averageDemElevation() calculates the average elevation of this area.
 void convertToVerticalFeet()
          covertToVerticalFeet() changes the internal representation of data in the dem from Meters to Feet, (or leaves the units unchanged if they are already in Feet.
 void convertToVerticalMeters()
          covertToVerticalMeters() changes the internal representation of data in the dem from Feet to Meters, (or leaves the units unchanged if they are already in Meters.
 short get_elevation_unit()
          public short get_elevation_unit() is a method of Dem.java that is overridden in this class.
 PreciseUTMcoordPair getNEcorner()
          Returns the NE corner of the table
 PreciseUTMcoordPair getNWcorner()
          Returns the NW corner of the table
 UtmCoordinatePairElev getPoint(int easting, int northing)
          Teturns a UtmCoordinatePairElev object from table representing the closest point (snapped to grid) to the easting and northing provided.
 UtmCoordinatePairElev getPoint(java.awt.Point point)
          public UtmCoordinatePairElev getUTMdataPoint(Point point) returns a UtmCoordinatePairElev object from table representing the Point.
 UtmCoordinatePairElev getPoint(short x, short y)
          public UtmCoordinatePairElev getUTMdataPoint(short x, short y) returns a UtmCoordinatePairElev object from table representing the x and y.
 UtmCoordinatePairElev[][] getPoints(int easting, int northing, int easting_meters, int northing_meters)
          returns a UtmCoordinatePairElev[][] object where the sw_corner is easting, northing, the size of easting_meters east and northing_meters north.
 PreciseUTMcoordPair getSEcorner()
          Returns the SE corner of the table
 PreciseUTMcoordPair getSWcorner()
          Returns the SW corner of the table
 UtmCoordinatePairElev[][] getTable()
          Returns the table of UTMcoodinatePairElev points for the dem.
 UtmCoordinatePairElev getUTMdataPoint(int x, int y)
          Deprecated. This method is deprecated, its functionality replaced by the public UtmCoordinatePairElev getPoint(short x, short y) method.
 UtmCoordinatePairElev getUTMdataPoint(java.awt.Point point)
          Deprecated. This method is deprecated, its functionality replaced by the public UtmCoordinatePairElev getPoint(Point point) method.
 java.awt.Point getXYofUtmPoint(UtmCoordinatePair target)
          Returns a java.awt.Point describing the x,y location of the given UtmCoordinatePair target within the tabular representation of the points.
 
Methods inherited from class com.c5corp.c5dem.Dem
get_accuracy_code, get_availability, get_column_count, get_contour_interval_l, get_contour_interval_s, get_counter_angle, get_data_edition, get_data_rmse_sample_size, get_data_rmse, get_dem_level_code, get_elevation_pattern, get_file_name, get_file_rmse_sample_size, get_file_rmse, get_ground_coordinates, get_horizontal_datum, get_inspection_flag, get_largest_interval, get_max_elevation, get_mc_origin, get_min_and_max_values, get_min_elevation, get_percent_void, get_planimetric_system, get_planimetric_unit, get_planimetric_zone, get_polygon_sides, get_projection_parameters, get_revision_date, get_rows_and_columns, get_smallest_primary, get_source_date, get_spacial_rez_x, get_spacial_rez_y, get_spacial_rez_z, get_stats_available, get_suspect_and_void_flag, get_validation_flag, get_vertical_datum, get_xyz_resolution, getAvailability, getInputFile, getStatsAvailable, getTypeB, maxElevationsForAllProfiles, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DemTable

public DemTable(java.net.URL url)
Constructs a DEM from a java.net.URL

Parameters:
url - The URL for a DEM
Since:
1.0.3b
See Also:
URL

DemTable

public DemTable(java.io.File file)
Constructs a DEM from an input file specified in java.io.File file

Parameters:
file - a DEM File

DemTable

public DemTable(java.lang.String inputfile)
Constructs a DEM from an input file specified in String inputfile

Parameters:
inputfile - String containing a path to the DEM
Method Detail

getTable

public UtmCoordinatePairElev[][] getTable()
Returns the table of UTMcoodinatePairElev points for the dem.

Returns:
UtmCoordinatePairElev[][] representing the DEM data

getPoints

public UtmCoordinatePairElev[][] getPoints(int easting,
                                           int northing,
                                           int easting_meters,
                                           int northing_meters)
returns a UtmCoordinatePairElev[][] object where the sw_corner is easting, northing, the size of easting_meters east and northing_meters north. This method returns null if it can not return the full array for the area requested.

Parameters:
easting - the UTM easting value
northing - the UTM norting value
easting_meters - meters to the east
northing_meters - meters to the north
Returns:
UtmCoordinatePairElev[][] representing the requested area
Since:
1.0.3

getUTMdataPoint

public UtmCoordinatePairElev getUTMdataPoint(java.awt.Point point)
Deprecated. This method is deprecated, its functionality replaced by the public UtmCoordinatePairElev getPoint(Point point) method.

public UtmCoordinatePairElev getUTMdataPoint(Point point) returns a UtmCoordinatePairElev object from table representing the Point.

Parameters:
point -
Returns:
a UtmCoordinatePairElev object from table

getUTMdataPoint

public UtmCoordinatePairElev getUTMdataPoint(int x,
                                             int y)
Deprecated. This method is deprecated, its functionality replaced by the public UtmCoordinatePairElev getPoint(short x, short y) method.

public UtmCoordinatePairElev getUTMdataPoint(int x, int y) returns a UtmCoordinatePairElev object from table representing the x and y.

Parameters:
x - x value
y - y value
Returns:
a UtmCoordinatePairElev object from table

getPoint

public UtmCoordinatePairElev getPoint(java.awt.Point point)
public UtmCoordinatePairElev getUTMdataPoint(Point point) returns a UtmCoordinatePairElev object from table representing the Point.

Parameters:
point - UtmCoordinatePairElev object from table representing the Point
Returns:
a UtmCoordinatePairElev object from table

getPoint

public UtmCoordinatePairElev getPoint(short x,
                                      short y)
public UtmCoordinatePairElev getUTMdataPoint(short x, short y) returns a UtmCoordinatePairElev object from table representing the x and y.

Parameters:
x - x value
y - y value
Returns:
a UtmCoordinatePairElev object from table

getPoint

public UtmCoordinatePairElev getPoint(int easting,
                                      int northing)
Teturns a UtmCoordinatePairElev object from table representing the closest point (snapped to grid) to the easting and northing provided. The UtmCoordinatePairElev returned will always be snapped to the closest point greater than the easting and northing points. Returns a null value if it can not find a point snapping to the dem file.

Parameters:
easting - the UTM easting
northing - the UTM northing
Returns:
the closest UtmCoordinatePairElev in the table to easting, northing

getSWcorner

public PreciseUTMcoordPair getSWcorner()
Returns the SW corner of the table

Returns:
the PreciseUTMcoordPair representing the SW corner of the table

getNWcorner

public PreciseUTMcoordPair getNWcorner()
Returns the NW corner of the table

Returns:
the PreciseUTMcoordPair representing the NW corner of the table

getNEcorner

public PreciseUTMcoordPair getNEcorner()
Returns the NE corner of the table

Returns:
the PreciseUTMcoordPair representing the NE corner of the table

getSEcorner

public PreciseUTMcoordPair getSEcorner()
Returns the SE corner of the table

Returns:
the PreciseUTMcoordPair representing the SE corner of the table

get_elevation_unit

public short get_elevation_unit()
public short get_elevation_unit() is a method of Dem.java that is overridden in this class. public void convertToVerticalFeet() and public void convertToVerticalMeters() toggle this value to represent feet (1) or meters (2) after converting the values in the table to the indicated unit.

Overrides:
get_elevation_unit in class Dem
Returns:
Data Element 9 - Code defining unit of measure for elevation coordinates throughout the file

getXYofUtmPoint

public java.awt.Point getXYofUtmPoint(UtmCoordinatePair target)
Returns a java.awt.Point describing the x,y location of the given UtmCoordinatePair target within the tabular representation of the points. Added in version 1.0.3b

Parameters:
target -
Returns:
a java.awt.Point containing the X,Y coordinates of the target with in the table
See Also:
getTable()

convertToVerticalFeet

public void convertToVerticalFeet()
covertToVerticalFeet() changes the internal representation of data in the dem from Meters to Feet, (or leaves the units unchanged if they are already in Feet. see public short get_elevation_unit(), a method of Dem.java that is overridden in this class. public short get_elevation_unit() returns 1 if the vertical units are in feet.


convertToVerticalMeters

public void convertToVerticalMeters()
covertToVerticalMeters() changes the internal representation of data in the dem from Feet to Meters, (or leaves the units unchanged if they are already in Meters. see public short get_elevation_unit(), a method of Dem.java that is overridden in this class. public short get_elevation_unit() returns 2 if the vertical units are in Meters.


averageDemElevation

public double averageDemElevation()
averageDemElevation() calculates the average elevation of this area.

Returns:
the average elevation
Since:
2.0