OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDemStats.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Ken Melero
9 // Orginally written by Jamie Moyers (jmoyers@geeks.com)
10 // Adapted from the package KDEM.
11 // Description: This class provides some statistics for DEMs.
12 //
13 //********************************************************************
14 // $Id: ossimDemStats.cpp 17206 2010-04-25 23:20:40Z dburken $
15 
16 #include <stdlib.h>
17 
20 using namespace std;
21 
23  : _availCodeDE2(0),
24  _rsmeDE2x(0),
25  _rsmeDE2y(0),
26  _rsmeDE2z(0),
27  _sampleSizeDE2(0),
28  _availCodeDE5(0),
29  _rsmeDE5x(0),
30  _rsmeDE5y(0),
31  _rsmeDE5z(0),
32  _sampleSizeDE5(0)
33 
34 {
35 }
36 
38 {
39 }
40 
41 long
43 {
44  return _availCodeDE2;
45 }
46 
47 long
49 {
50  return _rsmeDE2x;
51 }
52 
53 long
55 {
56  return _rsmeDE2y;
57 }
58 
59 long
61 {
62  return _rsmeDE2z;
63 }
64 
65 long
67 {
68  return _sampleSizeDE2;
69 }
70 
71 long
73 {
74  return _availCodeDE5;
75 }
76 
77 long
79 {
80  return _rsmeDE5x;
81 }
82 
83 long
85 {
86  return _rsmeDE5y;
87 }
88 
89 long
91 {
92  return _rsmeDE5z;
93 }
94 
95 long
97 {
98  return _sampleSizeDE5;
99 }
100 
101 ostream&
102 operator<<(ostream& s, ossimDemStats const& /* stats */)
103 {
104  return s;
105 }
106 
107 istream&
109 {
110  char bufstr[1024];
111 
112  ossimDemUtil::getRecord(s, bufstr);
113 
114  stats._availCodeDE2 = ossimDemUtil::getLong(bufstr, 0, 6);
115  stats._rsmeDE2x = ossimDemUtil::getLong(bufstr, 6, 6);
116  stats._rsmeDE2y = ossimDemUtil::getLong(bufstr, 12, 6);
117  stats._rsmeDE2z = ossimDemUtil::getLong(bufstr, 18, 6);
118  stats._sampleSizeDE2 = ossimDemUtil::getLong(bufstr, 24, 6);
119  stats._availCodeDE5 = ossimDemUtil::getLong(bufstr, 30, 6);
120  stats._rsmeDE5x = ossimDemUtil::getLong(bufstr, 36, 6);
121  stats._rsmeDE5y = ossimDemUtil::getLong(bufstr, 42, 6);
122  stats._rsmeDE5z = ossimDemUtil::getLong(bufstr, 48, 6);
123  stats._sampleSizeDE5 = ossimDemUtil::getLong(bufstr, 54, 6);
124 
125  return s;
126 }
long getRSMEDE2y() const
long getRSMEDE2z() const
long getRSMEDE5y() const
long getAvailCodeDE2() const
long getAvailCodeDE5() const
ostream & operator<<(ostream &s, ossimDemStats const &)
long getRSMEDE2x() const
long getRSMEDE5x() const
istream & operator>>(istream &s, ossimDemStats &stats)
static long getLong(char *const strbuf, long const startpos, long const width)
long getSampleSizeDE2() const
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
long getRSMEDE5z() const
long getSampleSizeDE5() const
static bool getRecord(ossim::istream &s, std::string &strbuf, long reclength=1024)
Reads a single record from a DEM.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23