OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDtedRecord.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Ken Melero
8 //
9 // Description: This class gives access to the Data Record Description
10 // of a DTED Level 1 file.
11 //
12 // Notes: Each elevation is a true value referenced to meas sea level
13 // (MSL) datum recorded to the nearest meter. The horizontal
14 // position is referenced to precise longitude-latitiude
15 // locations in terms of the current World Geodetic System
16 // (WGS84) determined for each file by reference to the origin
17 // at the southwest corner. The elevations are evenly spaced
18 // in latitude and longitude at the interval designated in the
19 // User Header Label (UHL) in South to North profile sequence.
20 //
21 //********************************************************************
22 // $Id: ossimDtedRecord.h 14248 2009-04-08 19:38:11Z dburken $
23 #ifndef ossimDtedRecord_H
24 #define ossimDtedRecord_H
25 #include <iosfwd>
26 
28 #include <ossim/base/ossimString.h>
30 
32 {
33 public:
35  ossim_int32 offest,
36  ossim_int32 num_points);
37  // NOTE: When using this class be sure that as you cycle through
38  // all the points within a record, that you verify they are
39  // sequential. According to the DTED Specification
40  // (MIL-PRF-89020A) issued in 19 April 1996, page 22 all
41  // records must be sequential. If not, file may be corrupt.
42  //
43  // To verify this, you can do the following:
44  //
45  // int count = 0;
46  // for(int i = 0; i < num_lon_lines; i++)
47  // rec[i] = new ossimDtedRecord(theFileDesc, offset,
48  // num_lat_points);
49  // if(count != (rec[i]->dataBlockCount() + 1))
50  // ERROR -- Records are not sequential
51  // count = rec[i]->dataBlockCount();
52 
53  ~ossimDtedRecord();
54 
55  enum
56  {
57  DATA_LENGTH = 12,
58  DATA_BLOCK_COUNT = 2,
59  DATA_LON_COUNT = 4,
60  DATA_LAT_COUNT = 6,
61  DATA_ELEV_START = 8,
62  DATA_BYTES_PER_POINT = 2,
63  };
64 
65  // The Recognition Sentinel signifies if the Data Record exists.
66  ossimString recognitionSentinel() const;
67 
68  ossim_int32 dataBlockCount() const;
69  ossim_int32 lonCount() const;
70  ossim_int32 latCount() const;
71  ossim_uint32 checkSum() const;
72  ossim_uint32 computedCheckSum() const;
73  ossim_int32 numPoints() const;
74 
75  // Access methods for the elevation data
76  ossim_int32 getPoint(ossim_int32 i) const;
77  ossim_uint16 getPointData(ossim_int32 i) const;
78  ossim_int32* points() const;
79  ossim_uint16* pointsData() const;
80 
81  ossim_int32 startOffset() const;
82  ossim_int32 stopOffset() const;
83 
85  const ossimDtedRecord& rec);
86  void parse(std::istream& in);
87 
88 private:
89  // prevent use
90  ossimDtedRecord(const ossimDtedRecord& source);
91 
93 
98 
103 
110 
117 
126 
132 
138 
144 
149 
152 
161  bool validateCheckSum(std::istream& in);
162 };
163 
164 #endif
ossim_int32 theNumPoints
ossim_int32 theStartOffset
ossim_int32 theLonCount
ossimString theRecSen
unsigned short ossim_uint16
ossim_int32 theStopOffset
unsigned int ossim_uint32
ossim_int32 theFile
ossim_int32 theDataBlockCount
ossim_int32 theLatCount
ossim_uint32 theComputedCheckSum
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
ossim_int32 * thePoints
friend OSSIMDLLEXPORT std::ostream & operator<<(std::ostream &out, const ossimErrorStatusInterface &obj)
#define OSSIM_DLL
ossim_uint32 theCheckSum
ossim_uint16 * thePointsData
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32