com.c5corp.c5dem
Class TypeA

java.lang.Object
  extended by com.c5corp.c5dem.TypeA

public class TypeA
extends java.lang.Object

Object model of a Type A DEM record. There is a great deal of conflicting infomation about the DEM format. The notes below are taken from the Digital Elevation Model Data Users Guide 5, published in 1993. It assumes that the "new" format DEM file that supports data elements 17 through 29. It appears to support post OCT 2001 files, 1:24000 large scale dems. It is only intended to support USGS 7.5 minute large scale 1:24000 dems, (utm coords only).

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

Constructor Summary
TypeA(java.lang.String instring)
          Constructor for input from an InputStream specified by the path given in String instream.
TypeA(java.net.URL url)
          Constructor for input from an InputStream specified by the path given in String instream.
 
Method Summary
 short get_contour_intervalL()
          Returns the dem specification Data Element 18 - Source contour interval units.
 short get_contour_intervalS()
          Returns the dem specification Data Element 20 - Source contour interval units Corresponds to the units of the map smallest primary contour interval.
 double[][] get_corners()
          Returns the dem specification Data Element 11 (a 4x2 array) - A 4,2 array containing the ground coordinates of the four corners for the DEM.
 double get_counter_angle()
          Returns the dem specification Data Element 13 - Counterclockwise angle (in radians) from the primary axis of ground planimetric reference to the primary axis of the DEM local reference system.
 short get_data_edition()
          Returns the dem specification Data Element 28 - Data Edition: 01-99 Primarily a NIMA specific field.
 short get_dem_level_code()
          Returns the dem specification Data Element 3 - DEM level code: 1=DEM-1, 2=DEM-2, 3=DEM-3
 short get_elevation_accuracy()
          Returns the dem specification Data Element 14 - Accuracy code for elevations: 0=unknown accuracy, 1=accuracy information is given in logical record type C.
 short get_elevation_pattern()
          Returns the dem specification Data Element 4 - Code defining elevation pattern (regular or random): 1=regular, 2=random is reserved for future use.
 short get_elevation_unit()
          Returns the dem specification Data Element 9 - Code defining unit of measure for elevation coordinates throughout the file: 1=feet, 2=meters.
 java.lang.String get_file_name()
          Returns the dem spefication Data Element 1 - the file name.
 short get_horizontal_datum()
          Returns the dem specification Data Element 27 - Horizontal datum:
1=North American Datum 1927 (NAD 27)
2=World Geodetic System 1972 (WGS 72)
3=WGS 84
4=NAD 83
5=Old Hawaii Datum
6=Puerto Rico Datum
7=NAD 83 Provisional
(shifts in horizontal coordinates are computed, but old DEM nodes are not resampled)
 int get_inspection_date()
          Returns the dem specification Data Element 22 - Data inspection revision date, YYMM two-digit year and two-digit month.
 char get_inspection_flag()
          Returns the dem specification Data Element 23 - Inspection revision flag, "I" or "R"
 short get_largest_interval()
          Returns the dem specification Data Element 17 - Largest primary contour interval.
 java.lang.String get_mc_origin()
          Returns the dem specification Data Element 2 - MC origin code, Mapping Center origin Code.
 double[] get_min_and_max_values()
          Returns the dem specification Data Element 12 (a 2 element array) - A two-element array containing minimum and maximum elevations for the DEM.
 short get_percent_void()
          Returns the dem specification Data Element 29 - Percent Void: If element 25 indicates a void, this field (right justified) contains the percentage of nodes in the file set to void (-32,767).
 short get_planimetric_system()
          Returns the dem specification Data Element 5 - Code defining ground planimetric reference system: 0=Geographic, 1=UTM, 2=State plane.
 short get_planimetric_unit()
          Returns the dem specification Data Element 8 - Code defining unit of measure for ground planimetric units throughout the file: 0=radians, 1=feet, 2=meters, 3=arc-seconds Normally set to code 2 for 7.5-minute DEM's.
 short get_planimetric_zone()
          Returns the dem specification Data Element 6 - Code defining zone in ground planimetric reference system 163-168 Codes for State plane and UTM coor- dinate zones are given in appendixes D and E for 7.5-minute DEM's.
 double[] get_projection_parameters()
          Returns the dem specification Data Element 7 (15 element array) - Map projectionparameters (see appendix F) of measure for ground planimetric coordinates through-out the file Definition of parameters for various projections is given in appendix F.
 short[] get_rows_and_columns()
          Returns the dem specification Data Element 16 - A two-element array containing the number of rows and columns (m,n) of profiles in the DEM When the row value m is set to 1 the n value describes the number of columns in the DEM file.
 short get_sides()
          Returns the dem specification Data Element 10 - The number (n) of sides in the polygon which defines the coverage of the DEM file, normally 4.
 short get_smallest_primary()
          Returns the dem specification Data Element 19 - Smallest primary.
 short get_source_date()
          Returns the dem specification Data Element 21 - Data source date YYMM two-digit year and two-digit month.
 short get_suspect_and_void_flag()
          Returns the dem specification Data Element 25 - Suspect and void area flag: 0=none, 1=suspect areas, 2=void areas, 3=suspect and void areas
 short get_validation_flag()
          Returns the dem specification Data Element 24 - Data validation flag:
0= No validation performed.
1=TESDEM (record C added) no qualitative test (no DEM Edit System [DES] review).
2=Water body edit and TESDEM run.
3=DES (includes water edit) no qualitative test (no TESDEM).
4=DES with record C added, qualita tive and quantitative tests for level 1 DEM.
5=DES and TESDEM qualitative and quantitative tests for levels 2 and 3 DEM's.
 short get_vertical_datum()
          Returns the dem specification Data Element 26 - Vertical datum:
1=local mean sea level
2=National Geodetic Vertical Datum 1929 (NGVD 29)
3=North American Vertical Datum 1988 (NAVD 88)
 double[] get_xyz_resolution()
          Returns the dem specification Data Element 15 (a 3 element array) - A three-element array of DEM spatial resolution for x, y, z.
 Reader getReader()
          Method for TypeBprofiles objects to get the Reader object.
 java.lang.String toString()
          overrides java.lang.Object.toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeA

public TypeA(java.lang.String instring)
Constructor for input from an InputStream specified by the path given in String instream. This basic constructor for a TypeA object builds itself from an filename. This is public because there are times when it is useful to open the type A data outside of this package.

Parameters:
instring -

TypeA

public TypeA(java.net.URL url)
Constructor for input from an InputStream specified by the path given in String instream. This basic constructor for a TypeA object builds itself from an filename. This is public because there are times when it is useful to open the type A data outside of this package.

Parameters:
url -
Method Detail

get_file_name

public java.lang.String get_file_name()
Returns the dem spefication Data Element 1 - the file name.

Returns:
the dem spefication Data Element 1

get_mc_origin

public java.lang.String get_mc_origin()
Returns the dem specification Data Element 2 - MC origin code, Mapping Center origin Code. Valid codes are EMC, WMC, MCMC, RMMC, FS, GPM2.

Returns:
Data Element 2 - MC origin code

get_dem_level_code

public short get_dem_level_code()
Returns the dem specification Data Element 3 - DEM level code: 1=DEM-1, 2=DEM-2, 3=DEM-3

Returns:
Data Element 3 - DEM level code

get_elevation_pattern

public short get_elevation_pattern()
Returns the dem specification Data Element 4 - Code defining elevation pattern (regular or random): 1=regular, 2=random is reserved for future use.

Returns:
Data Element 4 - Code defining elevation pattern

get_planimetric_system

public short get_planimetric_system()
Returns the dem specification Data Element 5 - Code defining ground planimetric reference system: 0=Geographic, 1=UTM, 2=State plane. (For codes 3-20, see appendix F, USGS DEM Data Users Guide Code 0 represents the geographic (latitude/longitude) system for 30-minute, 1-degree and Alaska DEM's. Code 1 represents the current use of the UTM coordinate system for 7.5-minute DEM's.

Returns:
Data Element 5 - Code defining ground planimetric reference system

get_planimetric_zone

public short get_planimetric_zone()
Returns the dem specification Data Element 6 - Code defining zone in ground planimetric reference system 163-168 Codes for State plane and UTM coor- dinate zones are given in appendixes D and E for 7.5-minute DEM's. Code is set to zero if element 5 is also set to zero defining data as geographic.

Returns:
Data Element 6 - Code defining zone in ground planimetric reference system

get_projection_parameters

public double[] get_projection_parameters()
Returns the dem specification Data Element 7 (15 element array) - Map projectionparameters (see appendix F) of measure for ground planimetric coordinates through-out the file Definition of parameters for various projections is given in appendix F. All 15 fields of this element are set to zero and should be ignored when geographic, UTM, or State plane coordinates are coded in data element 5.

Returns:
Data Element 7 - Map projectionparameters

get_planimetric_unit

public short get_planimetric_unit()
Returns the dem specification Data Element 8 - Code defining unit of measure for ground planimetric units throughout the file: 0=radians, 1=feet, 2=meters, 3=arc-seconds Normally set to code 2 for 7.5-minute DEM's. Always set to code 3 for 30-minute, 1-degree, and Alaska DEM's.

Returns:
Data Element 8 - Code defining unit of measure for ground planimetric units

get_elevation_unit

public short get_elevation_unit()
Returns the dem specification Data Element 9 - Code defining unit of measure for elevation coordinates throughout the file: 1=feet, 2=meters. Normally code 2, meters, for 7.5-minute, 30-minute, 1-degree, and Alaska DEM's.

Returns:
Data Element 9 - Code defining unit of measure for elevation coordinates throughout the file

get_sides

public short get_sides()
Returns the dem specification Data Element 10 - The number (n) of sides in the polygon which defines the coverage of the DEM file, normally 4.

Returns:
Data Element 10 - The number (n) of sides in the polygon defining the dem area

get_corners

public double[][] get_corners()
Returns the dem specification Data Element 11 (a 4x2 array) - A 4,2 array containing the ground coordinates of the four corners for the DEM. The coordinates of the quadrangle corners are ordered in a clockwise direction beginning with the southwest corner. The array is stored row-wise as pairs of eastings and northings.

Returns:
Data Element 11 - the ground coordinates of the four corners for the DEM

get_min_and_max_values

public double[] get_min_and_max_values()
Returns the dem specification Data Element 12 (a 2 element array) - A two-element array containing minimum and maximum elevations for the DEM. The values are in the unit of measure given by data element 9 in this record.

Returns:
Data Element 12 - minimum and maximum elevations for the DEM

get_counter_angle

public double get_counter_angle()
Returns the dem specification Data Element 13 - Counterclockwise angle (in radians) from the primary axis of ground planimetric reference to the primary axis of the DEM local reference system. Set to zero to align cordinate system specified in element 5.

Returns:
Data Element 13 - Counterclockwise angle

get_elevation_accuracy

public short get_elevation_accuracy()
Returns the dem specification Data Element 14 - Accuracy code for elevations: 0=unknown accuracy, 1=accuracy information is given in logical record type C.

Returns:
Data Element 14 - Accuracy code

get_xyz_resolution

public double[] get_xyz_resolution()
Returns the dem specification Data Element 15 (a 3 element array) - A three-element array of DEM spatial resolution for x, y, z. Units of measure are consistent with those indicated by data elements 8 and 9 in this record. These elements are usually set to:
30, 30, 1 for 7.5-minute DEM's
2, 2, 1 for 30-minute DEM's
3, 3, 1 for 1-degree DEM's
2, 1, 1 for high resolution DEM's in Alaska
3, 2, 1 for low resolution DEM's in Alaska
7.5-minute DEM'S will eventually be converted to geographics, i.e., 1,1,1.

Returns:
Data Element 15 - xyz spatial resolution

get_rows_and_columns

public short[] get_rows_and_columns()
Returns the dem specification Data Element 16 - A two-element array containing the number of rows and columns (m,n) of profiles in the DEM When the row value m is set to 1 the n value describes the number of columns in the DEM file. Raw GPM data files are set to m=16, n=16.

Returns:
Data Element 16 - number of rows and columns (m,n)

get_largest_interval

public short get_largest_interval()
Returns the dem specification Data Element 17 - Largest primary contour interval. Present only if two or more primary intervals exist.

Returns:
Data Element 17 - Largest primary contour interval

get_contour_intervalL

public short get_contour_intervalL()
Returns the dem specification Data Element 18 - Source contour interval units. Corresponds to the units of the map largest primary contour interval. 0=N.A., 1=feet, 2=meters.

Returns:
Data Element 18 - Source contour interval units.

get_smallest_primary

public short get_smallest_primary()
Returns the dem specification Data Element 19 - Smallest primary. Smallest or only primary contour interval

Returns:
Data Element 19 - Smallest primary contour interval

get_contour_intervalS

public short get_contour_intervalS()
Returns the dem specification Data Element 20 - Source contour interval units Corresponds to the units of the map smallest primary contour interval. 1=feet, 2=meters.

Returns:
Data Element 20 - source contour interval unit

get_source_date

public short get_source_date()
Returns the dem specification Data Element 21 - Data source date YYMM two-digit year and two-digit month. MM = 00 for source having year only.

Returns:
Data Element 21 - source date

get_inspection_date

public int get_inspection_date()
Returns the dem specification Data Element 22 - Data inspection revision date, YYMM two-digit year and two-digit month.

Returns:
Data Element 22 - Data inspection revision date

get_inspection_flag

public char get_inspection_flag()
Returns the dem specification Data Element 23 - Inspection revision flag, "I" or "R"

Returns:
Data Element 23 - Inspection revision flag

get_validation_flag

public short get_validation_flag()
Returns the dem specification Data Element 24 - Data validation flag:
0= No validation performed.
1=TESDEM (record C added) no qualitative test (no DEM Edit System [DES] review).
2=Water body edit and TESDEM run.
3=DES (includes water edit) no qualitative test (no TESDEM).
4=DES with record C added, qualita tive and quantitative tests for level 1 DEM.
5=DES and TESDEM qualitative and quantitative tests for levels 2 and 3 DEM's.

Returns:
Data Element 24 - Data validation flag

get_suspect_and_void_flag

public short get_suspect_and_void_flag()
Returns the dem specification Data Element 25 - Suspect and void area flag: 0=none, 1=suspect areas, 2=void areas, 3=suspect and void areas

Returns:
Data Element 25 - Suspect and void area flag

get_vertical_datum

public short get_vertical_datum()
Returns the dem specification Data Element 26 - Vertical datum:
1=local mean sea level
2=National Geodetic Vertical Datum 1929 (NGVD 29)
3=North American Vertical Datum 1988 (NAVD 88)

Returns:
Data Element 26 - vertical datum

get_horizontal_datum

public short get_horizontal_datum()
Returns the dem specification Data Element 27 - Horizontal datum:
1=North American Datum 1927 (NAD 27)
2=World Geodetic System 1972 (WGS 72)
3=WGS 84
4=NAD 83
5=Old Hawaii Datum
6=Puerto Rico Datum
7=NAD 83 Provisional
(shifts in horizontal coordinates are computed, but old DEM nodes are not resampled)

Returns:
Data Element 27 - Horizontal datum

get_data_edition

public short get_data_edition()
Returns the dem specification Data Element 28 - Data Edition: 01-99 Primarily a NIMA specific field.

Returns:
Data Element 28 - Data Edition:

get_percent_void

public short get_percent_void()
Returns the dem specification Data Element 29 - Percent Void: If element 25 indicates a void, this field (right justified) contains the percentage of nodes in the file set to void (-32,767).

Returns:
Data Element 29 - Percent Void

getReader

public Reader getReader()
Method for TypeBprofiles objects to get the Reader object.

Returns:
the Reader object

toString

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

Overrides:
toString in class java.lang.Object