OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDemHeader.cpp
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 // Orginally written by Jamie Moyers (jmoyers@geeks.com)
9 // Adapted from the package KDEM.
10 // Description: This class parses a DEM header.
11 //
12 //********************************************************************
13 // $Id$
14 
17 
18 #include <ossim/base/ossimCommon.h>
25 #include <ossim/base/ossimString.h>
26 
27 #include <fstream>
28 #include <iostream>
29 #include <iomanip>
30 
31 static const char* PROCESS_CODE[]
32 = { "Autocorrelation resample simple bilinear",
33  "Manual profile GRIDEM simple bilinear",
34  "DLG/hypsography CTOG 8-direction bilinear",
35  "Interpolation from photogrammetic system contours DCASS",
36  "direction bilinear",
37  "DLG/hypsography LINETRACE, LT4X complex linear",
38  "DLG/hypsography CPS-3, ANUDEM, GRASS complex polynomial",
39  "Electronic imaging (non-photogrammetric), active or passive",
40  "sensor systems" };
41 
42 static const int MAX_PROCESS_CODE_INDEX = 8;
43 
44 static const char* GROUND_REF_SYSTEM[]
45 = { "Geographic",
46  "UTM",
47  "State Plane" };
48 
49 static const int MAX_GROUND_REF_SYSTEM_INDEX = 2;
50 
51 static const char* GROUND_REF_SYSTEM_UNITS[]
52 = { "Radians",
53  "Feet",
54  "Meters",
55  "Arc Seconds" };
56 
57 static const int MAX_GROUND_REF_SYSTEM_UNITS_INDEX = 3;
58 
59 
60 static const char* VERTICAL_DATUM[]
61 = { "local mean sea level",
62  "National Geodetic Vertical Datum 1929",
63  "North American Vertical Datum 1988" };
64 
65 static const int MAX_VERTICAL_DATUM_INDEX = 2;
66 
67 static const char* HORIZONTAL_DATUM[]
68 = { "North American Datum 1927 (NAD 27)",
69  "World Geoditic System 1972 (WGS 72)",
70  "WGS 84",
71  "NAD 83",
72  "Old Hawaii Datum",
73  "Puerto Rico Datum" };
74 
75 static const int MAX_HORIZONTAL_DATUM_INDEX = 5;
76 
77 
79  : _seGeoCornerX(0.0),
80  _seGeoCornerY(0.0),
81  _processCode(0),
82  _levelCode(0),
83  _elevPattern(0),
84  _groundRefSysCode(0),
85  _groundRefSysZone(0),
86  _groundRefSysUnits(0),
87  _elevUnits(0),
88  _numPolySides(0),
89  _counterclockAngle(0.0),
90  _elevAccuracyCode(0),
91  _minElevation(0),
92  _maxElevation(0),
93  _spatialResX(0.0),
94  _spatialResY(0.0),
95  _spatialResZ(0.0),
96  _profileRows(0),
97  _profileColumns(0),
98  _largeContInt(0),
99  _maxSourceUnits(0),
100  _smallContInt(0),
101  _minSourceUnits(0),
102  _sourceDate(0),
103  _inspRevDate(0),
104  _valFlag(0),
105  _suspectVoidFlg(0),
106  _vertDatum(0),
107  _horizDatum(0),
108  _dataEdition(0),
109  _perctVoid(0),
110  _westEdgeFlag(0),
111  _northEdgeFlag(0),
112  _eastEdgeFlag(0),
113  _southEdgeFlag(0),
114  _vertDatumShift(0.0)
115 {
116 }
117 
118 std::string const&
120 {
121  return _quadName;
122 }
123 
124 std::string const&
126 {
127  return _processInfo;
128 }
129 
130 double
132 {
133  return _seGeoCornerX;
134 }
135 
136 double
138 {
139  return _seGeoCornerY;
140 }
141 
144 {
145  return _processCode;
146 }
147 
148 std::string const&
150 {
151  return _sectionIndicator;
152 }
153 
154 std::string const&
156 {
157  return _mapCenterCode;
158 }
159 
162 {
163  return _levelCode;
164 }
165 
168 {
169  return _elevPattern;
170 }
171 
174 {
175  return _groundRefSysCode;
176 }
177 
180 {
181  return _groundRefSysZone;
182 }
183 
186 {
187  return _groundRefSysUnits;
188 }
189 
192 {
193  return _elevUnits;
194 }
195 
198 {
199  return _numPolySides;
200 }
201 
202 ossimDemPointVector const&
204 {
205  return _demCorners;
206 }
207 
208 double
210 {
211  return _counterclockAngle;
212 }
213 
216 {
217  return _elevAccuracyCode;
218 }
219 
220 double
222 {
223  return _minElevation;
224 }
225 
226 double
228 {
229  return _maxElevation;
230 }
231 
232 double
234 {
235  return _spatialResX;
236 }
237 
238 double
240 {
241  return _spatialResY;
242 }
243 
244 double
246 {
247  return _spatialResZ;
248 }
249 
252 {
253  return _profileRows;
254 }
255 
258 {
259  return _profileColumns;
260 }
261 
264 {
265  return _largeContInt;
266 }
267 
270 {
271  return _maxSourceUnits;
272 }
273 
276 {
277  return _smallContInt;
278 }
279 
282 {
283  return _minSourceUnits;
284 }
285 
288 {
289  return _sourceDate;
290 }
291 
294 {
295  return _inspRevDate;
296 }
297 
298 std::string const&
300 {
301  return _inspFlag;
302 }
303 
306 {
307  return _valFlag;
308 }
309 
312 {
313  return _suspectVoidFlg;
314 }
315 
318 {
319  return _vertDatum;
320 }
321 
324 {
325  return _horizDatum;
326 }
327 
330 {
331  return _dataEdition;
332 }
333 
336 {
337  return _perctVoid;
338 }
339 
342 {
343  return _westEdgeFlag;
344 }
345 
348 {
349  return _northEdgeFlag;
350 }
351 
354 {
355  return _eastEdgeFlag;
356 }
357 
360 {
361  return _southEdgeFlag;
362 }
363 
364 double
366 {
367  return _vertDatumShift;
368 }
369 
372 {
373  return header.print(s);
374 }
375 
377 {
378  bool result = ossimDemUtil::isUsgsDem(file);
379  std::string connectionString = file.c_str();
380  std::shared_ptr<ossim::istream> is = ossim::StreamFactoryRegistry::instance()->
381  createIstream(connectionString, std::ios_base::in | std::ios_base::binary);
382  if(result)
383  {
384  if ( is && is->good() )
385  {
386  open( is, connectionString );
387  }
388  else
389  {
390  result = false;
391  }
392  }
393 
394  return result;
395 }
396 
397 
398 
399 bool ossimDemHeader::open(std::shared_ptr<ossim::istream>& str,
400  const std::string& connectionString)
401 {
402  bool result = ossimDemUtil::isUsgsDem(ossimFilename(connectionString));
403  if ( result&&str&& str->good() )
404  {
405 
406  char* bufstr = new char[1024];
407  char* temp = new char[1024];
408  ossim_int32 i;
409 
410  ossimDemUtil::getRecord(*str, bufstr);
411 
412  strncpy(temp, bufstr, 40);
413  temp[40] = '\0';
414  _quadName = temp;
415 
416  strncpy(temp,bufstr+40,40);
417  temp[40] = '\0';
418  _processInfo = temp;
419 
420  ossimDemUtil::getDouble(bufstr, 109, 13, _seGeoCornerX);
421  ossimDemUtil::getDouble(bufstr, 122, 13, _seGeoCornerY);
422  _processCode = ossimDemUtil::getLong(bufstr, 135, 1);
423 
424  strncpy(temp,bufstr+137,3);
425  temp[3] = '\0';
426  _sectionIndicator = temp;
427 
428  strncpy(temp,bufstr+140,4);
429  temp[4] = '\0';
430  _mapCenterCode = temp;
431 
432  _levelCode = ossimDemUtil::getLong(bufstr, 144, 6);
433  _elevPattern = ossimDemUtil::getLong(bufstr, 150, 6);
434  _groundRefSysCode = ossimDemUtil::getLong(bufstr, 156, 6);
435  _groundRefSysZone = ossimDemUtil::getLong(bufstr, 162, 6);
436  _groundRefSysUnits = ossimDemUtil::getLong(bufstr, 528, 6);
437  _elevUnits = ossimDemUtil::getLong(bufstr, 534, 6);
438  _numPolySides = ossimDemUtil::getLong(bufstr, 540, 6);
439 
440  for (i = 0; i < 4; i++)
441  {
442  double x,y;
443  ossim_int32 pos = 546 + (i * 48);
444  ossimDemUtil::getDouble(bufstr, pos, 24, x);
445  ossimDemUtil::getDouble(bufstr, pos + 24, 24, y);
446  _demCorners.push_back(ossimDemPoint(x,y));
447  }
448 
449  ossimDemUtil::getDouble(bufstr, 738, 24, _minElevation);
450  ossimDemUtil::getDouble(bufstr, 762, 24, _maxElevation);
451  ossimDemUtil::getDouble(bufstr, 786, 24, _counterclockAngle );
452  _elevAccuracyCode = ossimDemUtil::getLong(bufstr, 810, 6);
453  ossimDemUtil::getDouble(bufstr, 816, 12, _spatialResX);
454  ossimDemUtil::getDouble(bufstr, 828, 12, _spatialResY);
455  ossimDemUtil::getDouble(bufstr, 840, 12, _spatialResZ);
456  _profileRows = ossimDemUtil::getLong(bufstr, 852, 6);
457  _profileColumns = ossimDemUtil::getLong(bufstr, 858, 6);
458  _largeContInt = ossimDemUtil::getLong(bufstr, 864, 5);
459  _maxSourceUnits = ossimDemUtil::getLong(bufstr, 869, 1);
460  _smallContInt = ossimDemUtil::getLong(bufstr, 870, 5);
461  _minSourceUnits = ossimDemUtil::getLong(bufstr, 875, 1);
462  _sourceDate = ossimDemUtil::getLong(bufstr, 876, 4);
463  _inspRevDate = ossimDemUtil::getLong(bufstr, 880, 4);
464 
465  strncpy(temp, bufstr+884,1);
466  temp[1]='\0';
467  _inspFlag = temp;
468 
469  _valFlag = ossimDemUtil::getLong(bufstr, 885, 1);
470  _suspectVoidFlg = ossimDemUtil::getLong(bufstr, 886, 2);
471  _vertDatum = ossimDemUtil::getLong(bufstr, 888, 2);
472  _horizDatum = ossimDemUtil::getLong(bufstr, 890, 2);
473  if (_horizDatum == 0)
474  _horizDatum = 1; // Default to NAD27
475 
476  _dataEdition = ossimDemUtil::getLong(bufstr, 892, 4);
477  _perctVoid = ossimDemUtil::getLong(bufstr, 896, 4);
478  _westEdgeFlag = ossimDemUtil::getLong(bufstr, 900, 2);
479  _northEdgeFlag = ossimDemUtil::getLong(bufstr, 902, 2);
480  _eastEdgeFlag = ossimDemUtil::getLong(bufstr, 904, 2);
481  _southEdgeFlag = ossimDemUtil::getLong(bufstr, 906, 2);
482  ossimDemUtil::getDouble(bufstr, 908, 7, _vertDatumShift);
483 
484  delete [] bufstr;
485  delete [] temp;
486  bufstr = 0;
487  temp = 0;
488  }
489  return result;
490 }
491 
492 
494 {
495  if(in.good())
496  {
497  char* bufstr = new char[1024];
498  char* temp = new char[1024];
499  ossim_int32 i;
500 
501  ossimDemUtil::getRecord(in, bufstr);
502 
503  strncpy(temp, bufstr, 40);
504  temp[40] = '\0';
505  _quadName = temp;
506 
507  strncpy(temp,bufstr+40,40);
508  temp[40] = '\0';
509  _processInfo = temp;
510 
511  ossimDemUtil::getDouble(bufstr, 109, 13, _seGeoCornerX);
512  ossimDemUtil::getDouble(bufstr, 122, 13, _seGeoCornerY);
513  _processCode = ossimDemUtil::getLong(bufstr, 135, 1);
514 
515  strncpy(temp,bufstr+137,3);
516  temp[3] = '\0';
517  _sectionIndicator = temp;
518 
519  strncpy(temp,bufstr+140,4);
520  temp[4] = '\0';
521  _mapCenterCode = temp;
522 
523  _levelCode = ossimDemUtil::getLong(bufstr, 144, 6);
524  _elevPattern = ossimDemUtil::getLong(bufstr, 150, 6);
525  _groundRefSysCode = ossimDemUtil::getLong(bufstr, 156, 6);
526  _groundRefSysZone = ossimDemUtil::getLong(bufstr, 162, 6);
527  _groundRefSysUnits = ossimDemUtil::getLong(bufstr, 528, 6);
528  _elevUnits = ossimDemUtil::getLong(bufstr, 534, 6);
529  _numPolySides = ossimDemUtil::getLong(bufstr, 540, 6);
530 
531  for (i = 0; i < 4; i++)
532  {
533  double x,y;
534  ossim_int32 pos = 546 + (i * 48);
535  ossimDemUtil::getDouble(bufstr, pos, 24, x);
536  ossimDemUtil::getDouble(bufstr, pos + 24, 24, y);
537  _demCorners.push_back(ossimDemPoint(x,y));
538  }
539 
540  ossimDemUtil::getDouble(bufstr, 738, 24, _minElevation);
541  ossimDemUtil::getDouble(bufstr, 762, 24, _maxElevation);
542  ossimDemUtil::getDouble(bufstr, 786, 24, _counterclockAngle );
543  _elevAccuracyCode = ossimDemUtil::getLong(bufstr, 810, 6);
544  ossimDemUtil::getDouble(bufstr, 816, 12, _spatialResX);
545  ossimDemUtil::getDouble(bufstr, 828, 12, _spatialResY);
546  ossimDemUtil::getDouble(bufstr, 840, 12, _spatialResZ);
547  _profileRows = ossimDemUtil::getLong(bufstr, 852, 6);
548  _profileColumns = ossimDemUtil::getLong(bufstr, 858, 6);
549  _largeContInt = ossimDemUtil::getLong(bufstr, 864, 5);
550  _maxSourceUnits = ossimDemUtil::getLong(bufstr, 869, 1);
551  _smallContInt = ossimDemUtil::getLong(bufstr, 870, 5);
552  _minSourceUnits = ossimDemUtil::getLong(bufstr, 875, 1);
553  _sourceDate = ossimDemUtil::getLong(bufstr, 876, 4);
554  _inspRevDate = ossimDemUtil::getLong(bufstr, 880, 4);
555 
556  strncpy(temp, bufstr+884,1);
557  temp[1]='\0';
558  _inspFlag = temp;
559 
560  _valFlag = ossimDemUtil::getLong(bufstr, 885, 1);
561  _suspectVoidFlg = ossimDemUtil::getLong(bufstr, 886, 2);
562  _vertDatum = ossimDemUtil::getLong(bufstr, 888, 2);
563  _horizDatum = ossimDemUtil::getLong(bufstr, 890, 2);
564  if (_horizDatum == 0)
565  _horizDatum = 1; // Default to NAD27
566 
567  _dataEdition = ossimDemUtil::getLong(bufstr, 892, 4);
568  _perctVoid = ossimDemUtil::getLong(bufstr, 896, 4);
569  _westEdgeFlag = ossimDemUtil::getLong(bufstr, 900, 2);
570  _northEdgeFlag = ossimDemUtil::getLong(bufstr, 902, 2);
571  _eastEdgeFlag = ossimDemUtil::getLong(bufstr, 904, 2);
572  _southEdgeFlag = ossimDemUtil::getLong(bufstr, 906, 2);
573  ossimDemUtil::getDouble(bufstr, 908, 7, _vertDatumShift);
574 
575  delete [] bufstr;
576  delete [] temp;
577  bufstr = 0;
578  temp = 0;
579  }
580  return in;
581 }
582 
583 
585 {
586  const int W = 24; // format width
587  const int CW = W-8; // format corner width
588 
589  // Capture the original flags then set float output to full precision.
590  std::ios_base::fmtflags f = out.flags();
591 
592  // Note: This is only a partial print for now...
593  std::string prefix = "usgs_dem.";
594 
595  out << std::setiosflags(std::ios_base::fixed|std::ios_base::left)
596  << std::setprecision(10)
597 
598  << prefix << std::setw(W)
599  << "quadrangle_name:" << getQuadName().c_str() << "\n"
600  << prefix << std::setw(W)
601  << "process_info:" << getProcessInfo().c_str() << "\n"
602  << prefix << std::setw(W)
603  << "se_geo_corner_x:" << getSEGeoCornerX() << "\n"
604  << prefix << std::setw(W)
605  << "se_geo_corner_y:" << getSEGeoCornerY() << "\n"
606  << prefix << std::setw(W)
607  << "process_code:";
608 
609  ossim_int32 tmpl = getProcessCode() - 1;
610  if ( tmpl >= 0 && tmpl <= MAX_PROCESS_CODE_INDEX)
611  {
612  out << PROCESS_CODE[tmpl] << "\n";
613  }
614  else
615  {
616  out << "unknown" << "\n";
617  }
618 
619  out << prefix << std::setw(W)
620  << "section_indicator: " << getSectionIndicator().c_str() << "\n"
621  << prefix << std::setw(W)
622  << "mapping_center_code: " << getMappingCenterCode().c_str() << "\n"
623  << prefix << std::setw(W)
624  << "level_code: " << getLevelCode() << "\n"
625  << prefix << std::setw(W)
626  << "elev_pattern: " << getElevPattern() << "\n"
627  << prefix << std::setw(W) << "ground_ref_sys: ";
628 
629  tmpl = getGroundRefSysCode();
630  if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_INDEX)
631  {
632  out << GROUND_REF_SYSTEM[tmpl] << "\n";
633  }
634  else
635  {
636  out << "unknown\n";
637  }
638 
639  out << prefix << std::setw(W)
640  << "ground_ref_sys_zone: " << getGroundRefSysZone() << "\n"
641  << prefix << std::setw(W)
642  << "ground_ref_sys_units:";
643  tmpl = getGroundRefSysUnits();
644  if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_UNITS_INDEX)
645  {
646  out << GROUND_REF_SYSTEM_UNITS[tmpl] << "\n";
647  }
648  else
649  {
650  out << "unknown\n";
651  }
652 
653  out << prefix << std::setw(W)
654  << "elevation_units: ";
655  tmpl = getElevationUnits();
656  if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_UNITS_INDEX)
657  {
658  out << GROUND_REF_SYSTEM_UNITS[tmpl] << "\n";
659  }
660  else
661  {
662  out << "unknown\n";
663  }
664 
665  out << prefix << std::setw(W)
666  << "number_poly_sides: " << getNumPolySides() << "\n"
667  << prefix << std::setw(W)
668  << "counterclock_angle: " << getCounterclockAngle()<< "\n"
669  << prefix << std::setw(W)
670  << "elev_accuracy_code: " << getElevAccuracyCode()<< "\n"
671  << prefix << std::setw(W)
672  << "minimum_elevation: " << getMinimumElev() << "\n"
673  << prefix << std::setw(W)
674  << "maximum_elevation: " << getMaximumElev() << "\n"
675  << prefix << std::setw(W)
676  << "spatial_res_x: " << getSpatialResX() << "\n"
677  << prefix << std::setw(W)
678  << "spatial_res_y: " << getSpatialResY() << "\n"
679  << prefix << std::setw(W)
680  << "spatial_res_z:" << getSpatialResZ() << "\n"
681  << prefix << std::setw(W)
682  << "profile_rows: " << getProfileRows() << "\n"
683  << prefix << std::setw(W)
684  << "profile_columns:" << getProfileColumns() << "\n"
685  << prefix << std::setw(W)
686  << "source_date:" << getSourceDate() << "\n"
687  << prefix << std::setw(W)
688  << "revision_date:" << getInspRevDate() << "\n"
689  << prefix << std::setw(W)
690  << "vertical_datum:";
691 
692  tmpl = getVertDatum() - 1;
693  if ( tmpl >= 0 && tmpl <= MAX_VERTICAL_DATUM_INDEX)
694  {
695  out << VERTICAL_DATUM[tmpl] << "\n";
696  }
697  else
698  {
699  out << "unknown\n";
700  }
701 
702  out << prefix << std::setw(W)
703  << "vertical_datum_shift:" << getVertDatumShift() << "\n"
704  << prefix << std::setw(W)
705  << "horizontal_datum:";
706  tmpl = getHorizDatum() - 1;
707  if ( tmpl >= 0 && tmpl <= MAX_HORIZONTAL_DATUM_INDEX)
708  {
709  out << HORIZONTAL_DATUM[tmpl] << "\n";
710  }
711  else
712  {
713  out << "unknown\n";
714  }
715 
716  const ossimDemPointVector CORNERS = getDEMCorners();
717  for (unsigned int i=0; i < CORNERS.size(); ++i)
718  {
719  out << prefix << "corner[" << i
720  << std::setw(CW)<< "].x: " << CORNERS[i].getX() << "\n"
721  << prefix << "corner[" << i
722  << std::setw(CW)<< "].y: " << CORNERS[i].getY() << "\n"
723  << std::endl;
724  }
725 
726  out << std::endl;
727 
728  // Reset flags.
729  out.setf(f);
730 
731  return out;
732 }
733 
735 {
736  return header.open(s);
737 }
738 
740  const char* prefix) const
741 {
743  ossimString datum = getHorizDatumCode();
744  if ( (type == "unknown") || (datum == "unknown") )
745  {
746  return false;
747  }
748 
749  if (_demCorners.size() != 4)
750  {
751  return false;
752  }
753 
754  double tieX = _demCorners[1].getX();
755  double tieY = _demCorners[1].getY();
756  double scaleX = getSpatialResX();
757  double scaleY = getSpatialResX();
758 
759  // Add these for all projections.
760  kwl.add(prefix,
762  type);
763 
764  kwl.add(prefix,
766  datum);
767 
768  if (getGroundRefSysCode() == 0) // Geographic.
769  {
770  // ESH 10/2008 -- The Dem ground units can be either radians or
771  // arc seconds, so we have to convert parameters in these units
772  // to degrees which is what OSSIM is assuming.
773  bool bIsArcSecs = (getGroundRefSysUnits() == 3) ? true : false;
774  bool bIsRadians = (getGroundRefSysUnits() == 0) ? true : false;
775 
776  double convertFactor = 1.0;
777  if ( bIsArcSecs == true )
778  {
779  convertFactor = 1.0 / 3600;
780  }
781  else if ( bIsRadians == true )
782  {
783  convertFactor = 180.0 / M_PI;
784  }
785 
786  kwl.add(prefix,
788  (tieX * convertFactor) );
789  kwl.add(prefix,
791  (tieY * convertFactor) );
792  kwl.add(prefix,
794  (scaleX * convertFactor) );
795  kwl.add(prefix,
797  (scaleY * convertFactor) );
798  }
799  else if (getGroundRefSysCode() == 1) // UTM
800  {
801  // Get the zone.
802  kwl.add(prefix,
805 
806  // Set the hemisphere.
807  kwl.add(prefix,
809  (getGroundRefSysZone()<0?"S":"N"));
810 
811  // Set the tie.
812  if (getGroundRefSysUnits() == 1) // Feet...
813  {
814  tieX = ossim::usft2mtrs(tieX);
815  tieY = ossim::usft2mtrs(tieY);
816  scaleX = ossim::usft2mtrs(scaleX);
817  scaleY = ossim::usft2mtrs(scaleY);
818 
819  }
820  kwl.add(prefix,
822  tieX);
823  kwl.add(prefix,
825  tieY);
826  kwl.add(prefix,
828  scaleX);
829  kwl.add(prefix,
831  scaleY);
832  }
833  else if (getGroundRefSysCode() == 2) // State Plane
834  {
835  return false; // Need to code...
836  }
837 
838 
839  return true;
840 }
841 
843 {
844  ossimString code;
845  switch(getHorizDatum())
846  {
847  case 1:
848  code = "NAS-C";
849  break;
850  case 2:
851  code = "WGD";
852  break;
853  case 3:
854  code = "WGE";
855  break;
856  case 4:
857  code = "NAR-C";
858  break;
859  case 5:
860  code = "OHA-M";
861  break;
862  case 6:
863  code = "PUR";
864  break;
865  default:
866  code = "unknown";
867  break;
868  }
869  return code;
870 }
871 
873 {
874  ossimString type;
875  switch(getGroundRefSysCode())
876  {
877  case 0:
878  type = "ossimEquDistCylProjection";
879  break;
880  case 1:
881  type = "ossimUtmProjection";
882  break;
883  case 2:
884  default:
885  type = "unknown";
886  break;
887  }
888  return type;
889 }
ossim_int32 getDataValFlag() const
double getSpatialResY() const
ossim_int32 getWestEdgeFlag() const
ossim_uint32 x
ossim_int32 getGroundRefSysUnits() const
ossim_int32 getElevAccuracyCode() const
ossim_int32 getElevationUnits() const
static const char * DECIMAL_DEGREES_PER_PIXEL_LAT
ossim_int32 getElevPattern() const
ossim_int32 getSourceDate() const
static const char * DATUM_KW
ossimDemPointVector _demCorners
std::string _processInfo
ossim_int32 _maxSourceUnits
double getSEGeoCornerY() const
double _vertDatumShift
Represents serializable keyword/value map.
ossim_int32 getSouthEdgeFlag() const
ossim_uint32 y
bool open(const ossimFilename &file)
open method that takes a file.
std::string const & getMappingCenterCode() const
ossim_int32 getInspRevDate() const
ossim_int32 _suspectVoidFlg
ossim_int32 _levelCode
double getMinimumElev() const
std::string _sectionIndicator
ossim_int32 _processCode
static const char * TIE_POINT_LON_KW
ossim_int32 _perctVoid
ossimString getProjectionType() const
ossim_int32 getSmallContInt() const
static StreamFactoryRegistry * instance()
std::string const & getQuadName() const
std::string const & getProcessInfo() const
ossim_int32 getLargeContInt() const
#define abs(a)
Definition: auxiliary.h:74
ossim_int32 _inspRevDate
static const char * METERS_PER_PIXEL_Y_KW
static const char * TYPE_KW
ossim_int32 getMaxSourceUnits() const
ossim_int32 _vertDatum
ossim_int32 getGroundRefSysCode() const
ossim_int32 getPerctVoid() const
ossim_int32 _dataEdition
ossim_int32 _elevAccuracyCode
ossim_int32 _westEdgeFlag
double getVertDatumShift() const
static const char * TIE_POINT_NORTHING_KW
static long getLong(char *const strbuf, long const startpos, long const width)
ossim_int32 getMinSourceUnits() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * ZONE_KW
std::string const & getSectionIndicator() const
static bool isUsgsDem(const ossimFilename &file)
Does basic sanity checks to see if file is a dem.
#define M_PI
ossim_int32 _groundRefSysUnits
static const char * TIE_POINT_EASTING_KW
ossim_int32 _groundRefSysZone
ossim_int32 getDataEdition() const
static bool getDouble(std::string const &strbuf, long const startpos, long const width, double &val)
double _counterclockAngle
std::string const & getInspFlag() const
ossim_int32 getVertDatum() const
ossim_int32 _sourceDate
ossim_int32 getGroundRefSysZone() const
ossimString getHorizDatumCode() const
static const char * DECIMAL_DEGREES_PER_PIXEL_LON
ossim_int32 _numPolySides
std::vector< ossimDemPoint > ossimDemPointVector
Definition: ossimDemPoint.h:95
std::string _quadName
ossim_int32 getEastEdgeFlag() const
std::string _inspFlag
ossim_int32 getNumPolySides() const
ossim_int32 getProfileColumns() const
ossim_int32 _eastEdgeFlag
ossim_int32 getProfileRows() const
std::string _mapCenterCode
ossim_int32 _valFlag
ossim::istream & operator>>(ossim::istream &s, ossimDemHeader &header)
ossim_int32 _profileRows
ossim_int32 getSuspectVoidFlag() const
ossim_int32 _minSourceUnits
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
double usft2mtrs(double feet)
Definition: ossimCommon.h:373
double getSpatialResZ() const
std::ostream & operator<<(std::ostream &s, const ossimDemHeader &header)
const ossimDemPointVector & getDEMCorners() const
ossim_int32 _southEdgeFlag
ossim_int32 _smallContInt
double getSpatialResX() const
double getCounterclockAngle() const
static const char * HEMISPHERE_KW
ossim_int32 getNorthEdgeFlag() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossim_int32 getProcessCode() const
ossim_int32 _largeContInt
ossim_int32 _profileColumns
double getMaximumElev() const
static const char * TIE_POINT_LAT_KW
double getSEGeoCornerX() const
ossim_int32 _horizDatum
static bool getRecord(ossim::istream &s, std::string &strbuf, long reclength=1024)
Reads a single record from a DEM.
static const char * METERS_PER_PIXEL_X_KW
std::ostream & print(std::ostream &out) const
Print method.
ossim_int32 _northEdgeFlag
ossim_int32 getLevelCode() const
ossim_int32 getHorizDatum() const
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32
bool getImageGeometry(ossimKeywordlist &kwl, const char *prefix=NULL) const
ossim_int32 _groundRefSysCode
ossim_int32 _elevPattern
ossim_int32 _elevUnits