com.c5corp.c5dem
Class TypeB

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

public class TypeB
extends java.lang.Object

Object model of a Type B DEM record

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

Method Summary
 short get_column_id()
          A convenience method for Data element 1 retruning the column id
 double get_datum_elevation()
          Elevation of local datum for the profile The values are in the units of measure given by data element 9, logical record type A.
 int get_elevation_at(short i)
          Returns the elevation at index i converted to int in version 1.0.2
 int[] get_elevations()
          A m,n array of elevations for the profile.
 double[] get_first_elevation_coords()
          A two-element array containing the ground planimetric ^ coordinates (Xgo,Ygo) of the first elevation in the profile.
 double get_max_elevation()
          A convenience method for data element 5, the maximum elevation in the profile.
 double get_min_elevation()
          A convenience method for data element 5, the minumum elevation in the profile.
 short[] get_number_of_elevations()
          A two-element array containing the number (m, n) of elevations in the DEM profile, (Data element 2).
 short get_profile_columns()
          Convenience methods for Data Element 2, returns the number of columns per profile in this file.
 short get_profile_elevations()
          Convenience methods for Data Element 2, returns the number of elevations in this profile
 double[] get_profile_min_max()
          A two-element array of minimum and maximum elevations for the profile.
 short[] get_row_and_column_id()
          A two-element array representing data element 1, containing the row and column identification number of the DEM profile contained in this record.
 short get_row_id()
          A convenience method for Data element 1 retruning the row id
 double get_xgo()
          A convenience method for data element 3, the ground planimetric coordinates Xgo.
 double get_ygo()
          A convenience method for data element 3, the ground planimetric coordinates Ygo.
 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
 

Method Detail

get_row_and_column_id

public short[] get_row_and_column_id()
A two-element array representing data element 1, containing the row and column identification number of the DEM profile contained in this record. The row/column numbers may range from 1 to m and 1 to n. The row number is normally set to 1. The column identification is the profile sequence number.

Returns:
Type B data element 1, row and column identification number

get_row_id

public short get_row_id()
A convenience method for Data element 1 retruning the row id

Returns:
row id

get_column_id

public short get_column_id()
A convenience method for Data element 1 retruning the column id

Returns:
column id

get_number_of_elevations

public short[] get_number_of_elevations()
A two-element array containing the number (m, n) of elevations in the DEM profile, (Data element 2). The first element in the field corresponds to the number of rows and columns of nodes in this profile. The second element is set to 1, specifying 1 column per B record.

Returns:
number of elevations in profile, number of columns per profile

get_profile_elevations

public short get_profile_elevations()
Convenience methods for Data Element 2, returns the number of elevations in this profile

Returns:
number of elevations in this profile

get_profile_columns

public short get_profile_columns()
Convenience methods for Data Element 2, returns the number of columns per profile in this file. This should always be 1 - at least for typical 1:24000 files.

Returns:
number of columns per profile (most always 1)

get_first_elevation_coords

public double[] get_first_elevation_coords()
A two-element array containing the ground planimetric ^ coordinates (Xgo,Ygo) of the first elevation in the profile. (Data element 3).

Returns:
ground planimetric coords (easting, northing) of first elevation in the profile

get_xgo

public double get_xgo()
A convenience method for data element 3, the ground planimetric coordinates Xgo.

Returns:
Xgo

get_ygo

public double get_ygo()
A convenience method for data element 3, the ground planimetric coordinates Ygo.

Returns:
Ygo

get_datum_elevation

public double get_datum_elevation()
Elevation of local datum for the profile The values are in the units of measure given by data element 9, logical record type A. (Data element 4)

Returns:
local datum elevation
See Also:
TypeA.get_elevation_unit(), Dem.get_elevation_unit()

get_profile_min_max

public double[] get_profile_min_max()
A two-element array of minimum and maximum elevations for the profile. (Data element 5). The values are in the unit of measure given by data element 9 in logical record type A.

Returns:
array containing the min and max elevations in the profile
See Also:
TypeA.get_elevation_unit(), Dem.get_elevation_unit()

get_min_elevation

public double get_min_elevation()
A convenience method for data element 5, the minumum elevation in the profile.

Returns:
the min elevation in the profile

get_max_elevation

public double get_max_elevation()
A convenience method for data element 5, the maximum elevation in the profile.

Returns:
the max elevation in the profile

get_elevations

public int[] get_elevations()
A m,n array of elevations for the profile. (Data element 6). Elevations are expressed in units of resolution. 6x(146 or 170) 146 = max for first block. 170 = max for subsequent blocks. See data element 15 in appendix A. A value in this array would be multiplied by the spatial resolution value and added to the elevation of the local elevation datum for the element profile (data element 4 in this record) to obtain the elevation for the point. The planimetric ground coordinates of the point Xgp, Ygp, are computed according to the formulas in figure 5. (see dem specification, 1993)

Returns:
elevations array

get_elevation_at

public int get_elevation_at(short i)
Returns the elevation at index i converted to int in version 1.0.2

Parameters:
i - the index
Returns:
the elevation value at index i

toString

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

Overrides:
toString in class java.lang.Object