OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfCsexraTag.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: David Burken
8 //
9 // Description: CSEXRA tag class definition.
10 //
11 // Exploitation Reference Data TRE.
12 //
13 // See document STDI-0006-NCDRD Table 3.5-16 for more info.
14 //
15 //----------------------------------------------------------------------------
16 // $Id
17 
18 #include <cstring>
19 #include <istream>
20 #include <iostream>
21 #include <iomanip>
22 
24 
25 
27 
29  : ossimNitfRegisteredTag(std::string("CSEXRA"), 132)
30 {
31  clearFields();
32 }
33 
35 {
36 }
37 
39 {
40  clearFields();
41 
42  in.read(theSensor, 6);
43  in.read(theTileFirstLine, 12);
44  in.read(theImageTimeDuration, 12);
45  in.read(theMaxGsd, 5);
46  in.read(theAlongScanGsd, 5);
47  in.read(theCrossScanGsd, 5);
48  in.read(theGeoMeanGsd, 5);
49  in.read(theAlongScanVertGsd, 5);
50  in.read(theCrossScanVertGsd, 5);
51  in.read(theGeoMeanVertGsd, 5);
52  in.read(theGeoBetaAngle, 5);
53  in.read(theDynamicRange, 5);
54  in.read(theLine, 7);
55  in.read(theSamples, 5);
56  in.read(theAngleToNorth, 7);
57  in.read(theObliquityAngle, 6);
58  in.read(theAzOfObliquity, 7);
59  in.read(theGrdCover, 1);
60  in.read(theSnowDepthCategory, 1);
61  in.read(theSunAzimuth, 7);
62  in.read(theSunElevation, 7);
63  in.read(thePredictedNiirs, 3);
64  in.read(theCircularError, 3);
65  in.read(theLinearError, 3);
66 }
67 
69 {
70  out.write(theSensor, 6);
71  out.write(theTileFirstLine, 12);
72  out.write(theImageTimeDuration, 12);
73  out.write(theMaxGsd, 5);
74  out.write(theAlongScanGsd, 5);
75  out.write(theCrossScanGsd, 5);
76  out.write(theGeoMeanGsd, 5);
77  out.write(theAlongScanVertGsd, 5);
78  out.write(theCrossScanVertGsd, 5);
79  out.write(theGeoMeanVertGsd, 5);
80  out.write(theGeoBetaAngle, 5);
81  out.write(theDynamicRange, 5);
82  out.write(theLine, 7);
83  out.write(theSamples, 5);
84  out.write(theAngleToNorth, 7);
85  out.write(theObliquityAngle, 6);
86  out.write(theAzOfObliquity, 7);
87  out.write(theGrdCover, 1);
88  out.write(theSnowDepthCategory, 1);
89  out.write(theSunAzimuth, 7);
90  out.write(theSunElevation, 7);
91  out.write(thePredictedNiirs, 3);
92  out.write(theCircularError, 3);
93  out.write(theLinearError, 3);
94 }
95 
97 {
98  //---
99  // No attempt made to set to defaults.
100  // BCS-N's to '0's, BCS-A's to ' '(spaces)
101  //---
102 
103  memset(theSensor, ' ', 6);
104  memset(theTileFirstLine, 0, 12);
105  memset(theImageTimeDuration, 0, 12);
106  memset(theMaxGsd, 0, 5);
107  memset(theAlongScanGsd, ' ', 5);
108  memset(theCrossScanGsd, ' ', 5);
109  memset(theGeoMeanGsd, ' ', 5);
110  memset(theAlongScanVertGsd, ' ', 5);
111  memset(theCrossScanVertGsd, ' ', 5);
112  memset(theGeoMeanVertGsd, ' ', 5);
113  memset(theGeoBetaAngle, ' ', 5);
114  memset(theDynamicRange, 0, 5);
115  memset(theLine, 0, 7);
116  memset(theSamples, 0, 5);
117  memset(theAngleToNorth, 0, 7);
118  memset(theObliquityAngle, 0, 6);
119  memset(theAzOfObliquity, 0, 7);
120  memset(theGrdCover, 0, 1);
121  memset(theSnowDepthCategory, 0, 1);
122  memset(theSunAzimuth, 0, 7);
123  memset(theSunElevation, 0, 7);
124  memset(thePredictedNiirs, ' ', 3);
125  memset(theCircularError, 0, 3);
126  memset(theLinearError, 0, 3);
127 
128  theSensor[6] = '\0';
129  theTileFirstLine[12] = '\0';
130  theImageTimeDuration[12] = '\0';
131  theMaxGsd[5] = '\0';
132  theAlongScanGsd[5] = '\0';
133  theCrossScanGsd[5] = '\0';
134  theGeoMeanGsd[5] = '\0';
135  theAlongScanVertGsd[5] = '\0';
136  theCrossScanVertGsd[5] = '\0';
137  theGeoMeanVertGsd[5] = '\0';
138  theGeoBetaAngle[5] = '\0';
139  theDynamicRange[5] = '\0';
140  theLine[7] = '\0';
141  theSamples[5] = '\0';
142  theAngleToNorth[7] = '\0';
143  theObliquityAngle[6] = '\0';
144  theAzOfObliquity[7] = '\0';
145  theGrdCover[1] = '\0';
146  theSnowDepthCategory[1] = '\0';
147  theSunAzimuth[7] = '\0';
148  theSunElevation[7] = '\0';
149  thePredictedNiirs[3] = '\0';
150  theCircularError[3] = '\0';
151  theLinearError[3] = '\0';
152 
153 }
154 
156  std::ostream& out, const std::string& prefix) const
157 {
158  std::string pfx = prefix;
159  pfx += getTagName();
160  pfx += ".";
161 
162  out << setiosflags(std::ios::left)
163  << pfx << std::setw(24) << "CETAG:"
164  << getTagName() << "\n"
165  << pfx << std::setw(24) << "CEL:"
166  << getTagLength() << "\n"
167  << pfx << std::setw(24) << "SENSOR:"
168  << theSensor << "\n"
169  << pfx << std::setw(24) << "TIME_FIRST_LINE_IMAGE:"
170  << theTileFirstLine << "\n"
171  << pfx << std::setw(24) << "TIME_IMAGE_DURATION:"
172  << theImageTimeDuration << "\n"
173  << pfx << std::setw(24) << "MAX_GSD:"
174  << theMaxGsd << "\n"
175  << pfx << std::setw(24) << "ALONG_SCAN_GSD:"
176  << theAlongScanGsd << "\n"
177  << pfx << std::setw(24) << "CROSS_SCAN_GSD:"
178  << theCrossScanGsd << "\n"
179  << pfx << std::setw(24) << "GEO_MEAN_GSD:"
180  << theGeoMeanGsd << "\n"
181  << pfx << std::setw(24) << "A_S_VERT_GSD:"
182  << theAlongScanVertGsd << "\n"
183  << pfx << std::setw(24) << "C_S_VERT_GSD:"
184  << theCrossScanVertGsd << "\n"
185  << pfx << std::setw(24) << "GEO_MEAN_VERT_GSD:"
186  << theGeoMeanVertGsd << "\n"
187  << pfx << std::setw(24) << "GEO_BETA_ANGLE:"
188  << theGeoBetaAngle << "\n"
189  << pfx << std::setw(24) << "DYNAMIC_RANGE:"
190  << theDynamicRange << "\n"
191  << pfx << std::setw(24) << "NUM_LINES:"
192  << theLine << "\n"
193  << pfx << std::setw(24) << "NUM_SAMPLES:"
194  << theSamples << "\n"
195  << pfx << std::setw(24) << "ANGLE_TO_NORTH:"
196  << theAngleToNorth << "\n"
197  << pfx << std::setw(24) << "OBLIQUITY_ANGLE:"
198  << theObliquityAngle << "\n"
199  << pfx << std::setw(24) << "AZ_OF_OBLIQUITY:"
200  << theAzOfObliquity << "\n"
201  << pfx << std::setw(24) << "GRD_COVER:"
202  << theGrdCover << "\n"
203  << pfx << std::setw(24) << "SNOW_DEPTH_CAT:"
204  << theSnowDepthCategory << "\n"
205  << pfx << std::setw(24) << "SUN_AZIMUTH:"
206  << theSunAzimuth << "\n"
207  << pfx << std::setw(24) << "SUN_ELEVATION:"
208  << theSunElevation << "\n"
209  << pfx << std::setw(24) << "PREDICTED_NIIRS:"
210  << thePredictedNiirs << "\n"
211  << pfx << std::setw(24) << "CIRCL_ERR:"
212  << theCircularError << "\n"
213  << pfx << std::setw(24) << "LINEAR_ERR:"
214  << theLinearError<< "\n";
215 
216  return out;
217 }
218 
220 {
221  return ossimString(theSensor);
222 }
223 
225 {
227 }
228 
230 {
232 }
233 
235 {
236  return ossimString(theMaxGsd);
237 }
238 
240 {
242 }
243 
245 {
247 }
248 
250 {
251  return ossimString(theGeoMeanGsd);
252 }
253 
255 {
257 }
258 
260 {
262 }
263 
265 {
267 }
268 
270 {
272 }
273 
275 {
277 }
278 
280 {
281  return ossimString(theLine);
282 }
283 
285 {
286  return ossimString(theSamples);
287 }
288 
290 {
292 }
293 
295 {
297 }
298 
300 {
302 }
303 
305 {
306  return ossimString(theGrdCover);
307 }
308 
310 {
312 }
313 
315 {
316  return ossimString(theSunAzimuth);
317 }
318 
320 {
322 }
323 
325 {
327 }
328 
330 {
332 }
333 
335 {
336  return ossimString(theLinearError);
337 }
virtual const std::string & getTagName() const
This will return the name of the registered tag for this user defined header.
ossimString getTimeFirstLineImage() const
Get the TIME_FIRST_LINE_IMAGE field.
char theSunAzimuth[8]
FIELD: SUN_AZIMUTH.
char theGrdCover[2]
FIELD: GRD_COVER.
char theLine[8]
FIELD: NUM_LINES.
char theCircularError[4]
FIELD: CIRCL_ERR.
char theGeoMeanGsd[6]
FIELD: GEO_MEAN_GSD.
char theCrossScanGsd[6]
FIELD: CROSS_SCAN_GSD.
ossimString getSunElevation() const
Get the SUN_ELEVATION field.
virtual ~ossimNitfCsexraTag()
destructor
char theSensor[7]
FIELD: SENSOR.
RTTI_DEF1(ossimNitfCsexraTag, "ossimNitfCsexraTag", ossimNitfRegisteredTag)
ossimString getNumSamples() const
Get the NUM_SAMPLES field.
ossimString getLE90() const
Get the LINEAR_ERR field.
ossimString getMaxGsd() const
Get the MAX_GSDfield.
ossimString getAngleToNorth() const
Get the ANGLE_TO_NORTH field.
char theAzOfObliquity[8]
FIELD: AZ_OF_OBLIQUITY.
char theAlongScanGsd[6]
FIELD: ALONG_SCAN_GSD.
ossimString getPredictedNiirs() const
Get the PREDICTED_NIIRS field.
ossimString getObliquityAngle() const
Get the OBLIQUITY_ANGLE field.
char theObliquityAngle[7]
FIELD: OBLIQUITY_ANGLE.
ossimString getAlongScanGsd() const
Get the ALONG_SCAN_GSD field.
char theImageTimeDuration[13]
FIELD: TIME_IMAGE_DURATION.
char theSamples[6]
FIELD: NUM_SAMPLES.
virtual ossim_uint32 getTagLength() const
Returns the length in bytes of the tag from the CEL or REL field.
char theSnowDepthCategory[2]
FIELD: SNOW_DEPTH_CAT.
virtual void writeStream(std::ostream &out)
Method to write data to stream.
ossimString getSnowDepth() const
Get the SNOW_DEPTH_CAT field.
ossimString getAlongScanVerticalGsd() const
Get the A_S_VERT_GSD field.
char theDynamicRange[6]
FIELD: DYNAMIC_RANGE.
ossimString getCE90() const
Get the CIRCL_ERR field.
ossimString getTimeImageDuration() const
Get the TIME_IMAGE_DURATION field.
char thePredictedNiirs[4]
FIELD: PREDICTED_NIIRS.
ossimString getDynamicRange() const
Get the DYNAMIC_RANGE field.
virtual std::ostream & print(std::ostream &out, const std::string &prefix) const
Print method that outputs a key/value type format adding prefix to keys.
char theCrossScanVertGsd[6]
FIELD: C_S_VERT_GSD.
char theAlongScanVertGsd[6]
FIELD: A_S_VERT_GSD.
ossimString getCrossScanGsd() const
Get the CROSS_SCAN_GSD field.
char theMaxGsd[6]
FIELD: MAX_GSD.
ossimString getGeoMeanVerticalGsd() const
Get the GEO_MEAN_VERT_GSD field.
ossimString getSunAzimuth() const
Get the SUN_AZIMUTH field.
virtual void parseStream(std::istream &in)
Method to parse data from stream.
ossimString getGeoBetaAngle() const
Get the GEO_BETA_ANGLEfield.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
char theLinearError[4]
FIELD: LINEAR_ERR.
ossimString getGeoMeanGsd() const
Get the GEO_MEAN_GSD field.
ossimString getAzimuthOfObliquity() const
Get the AZ_OF_OBLIQUITY field.
char theSunElevation[8]
FIELD: SUN_ELEVATION.
char theGeoBetaAngle[6]
FIELD: GEO_BETA_ANGLE.
ossimString getCrossScanVerticalGsd() const
Get the C_S_VERT_GSD field.
virtual void clearFields()
Method to clear all fields including null terminating.
ossimString getNumLines() const
Get the NUM_LINES field.
ossimString getSensor() const
Get the SENSOR field.
ossimNitfCsexraTag()
default constructor
char theGeoMeanVertGsd[6]
FIELD: GEO_MEAN_VERT_GSD.
char theTileFirstLine[13]
FIELD: TIME_FIRST_LINE_IMAGE.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
char theAngleToNorth[8]
FIELD: ANGLE_TO_NORTH.
ossimString getGroundCover() const
Get the GRD_COVER field.