35 static const ossim_uint16 DATA_RECOGNITION_SENTINEL = 0xAA;
40 static const int BLOCK_COUNT_OFFSET = 2;
41 static const int LON_INDEX_OFFSET = 4;
42 static const int LAT_INDEX_OFFSET = 6;
43 static const int ELEV_DATA_OFFSET = 8;
44 static const int RECORD_HDR_LENGTH = 12;
45 static const int BYTES_PER_POINT = 2;
61 theComputedCheckSum(0),
62 theNumPoints(num_points),
63 theStartOffset(offset),
64 theStopOffset(offset + RECORD_HDR_LENGTH + (num_points*BYTES_PER_POINT))
69 in.read((
char*)buf, 1);
72 printf(
"\nBuf: %02X", (
int)buf[0]);
75 if(buf[0] != DATA_RECOGNITION_SENTINEL)
101 <<
"FATAL ossimDtedRecord::ossimDtedRecord:" 102 <<
"\nInvalid checksum in data record at: " 106 <<
"\nDTED Elevation File is considered corrupted." 138 in.read((
char*)&s, 2);
140 (swap_bytes ? ( ( (s & 0x00ff) << 8) | ( (s & 0xff00) >> 8) ) : s);
144 in.read((
char*)&s, 2);
146 (swap_bytes ? ( ( (s & 0x00ff) << 8) | ( (s & 0xff00) >> 8) ) : s);
150 in.read((
char*)&s, 2);
152 (swap_bytes ? ( ( (s & 0x00ff) << 8) | ( (s & 0xff00) >> 8) ) : s);
158 in.read((
char*)&s, 2);
159 s = (swap_bytes ? ( ( (s & 0x00ff) << 8) | ( (s & 0xff00) >> 8) ) : s);
160 if (s & DATA_SIGN_MASK)
162 s = (s & DATA_VALUE_MASK) * -1;
183 for(i = 0; i < bytesToRead; i++)
186 in.read((
char*)&c, 1);
276 os <<
"\nDTED Record:" 277 <<
"\n-------------------------------" 278 <<
"\n Recognition Sentinel: " << rec.
theRecSen 292 os <<
"\nPoint[" << i <<
"]: " << rec.
thePoints[i];
ossim_int32 startOffset() const
ossim_int32 lonCount() const
void parse(std::istream &in)
ossim_int32 stopOffset() const
ossim_int32 theStartOffset
std::ostream & operator<<(std::ostream &os, const ossimDtedRecord &rec)
ossimString recognitionSentinel() const
ossim_int32 * points() const
ossimDtedRecord(std::istream &in, ossim_int32 offest, ossim_int32 num_points)
OSSIM_DLL ossimByteOrder byteOrder()
static const ossimErrorCode OSSIM_ERROR
unsigned short ossim_uint16
ossim_int32 dataBlockCount() const
ossim_uint32 computedCheckSum() const
ossim_int32 theStopOffset
ossim_int32 getPoint(ossim_int32 i) const
signed short ossim_sint16
bool validateCheckSum(std::istream &in)
unsigned int ossim_uint32
ossim_int32 theDataBlockCount
ossim_int32 latCount() const
ossim_uint16 getPointData(ossim_int32 i) const
ossimErrorCode theErrorStatus
ossim_int32 numPoints() const
ossim_uint32 theComputedCheckSum
std::basic_istream< char > istream
Base class for char input streams.
ossim_uint16 * thePointsData
ossim_uint16 * pointsData() const
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
ossim_uint32 checkSum() const