OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimSpot6DimapSupportData.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2014 Centre National Etudes Spatiales
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 3 of the License, or (at your option) any later version.
8 //
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 //
18 // Author : Christophe Palmann (christophe.palmann@c-s.fr)
19 //
20 // Description:
21 //
22 // Contains declaration of class ossimSpot6DimapSupportData
23 //
24 //*****************************************************************************
25 
28 #include <ossim/base/ossimNotify.h>
30 #include <ossim/base/ossimTrace.h>
31 
36 
37 #include <ossimPluginCommon.h>
38 #include <ossim/base/ossimCommon.h>
39 
40 #include <ossim/base/ossimDatum.h>
42 
43 #include <cstdio>
44 #include <cstdlib>
45 #include <iostream>
46 #include <iterator>
47 #include <sstream>
48 
49 
50 // Define Trace flags for use within this file:
51 static ossimTrace traceExec ("ossimSpot6DimapSupportData:exec");
52 static ossimTrace traceDebug ("ossimSpot6DimapSupportData:debug");
53 
54 static std::string getVectorFloat64AsString(std::vector<ossim_float64> in)
55 {
56  std::vector<ossim_float64>::iterator it;
57  std::stringstream strTmp;
58 
59  for ( it=in.begin() ; it < in.end(); it++ )
60  {
61  strTmp << " " << (*it);
62  }
63 
64  return strTmp.str();
65 }
66 
67 static std::string getVectorDoubleAsString(std::vector<double> in)
68 {
69  std::vector<double>::iterator it;
70  std::stringstream strTmp;
71 
72  for ( it=in.begin() ; it < in.end(); it++ )
73  {
74  strTmp << " " << (*it);
75  }
76 
77  return strTmp.str();
78 }
79 
80 static std::string getVectorStringAsString(std::vector<ossimString> in)
81 {
82  std::vector<ossimString>::iterator it;
83  std::stringstream strTmp;
84 
85  for ( it=in.begin() ; it < in.end(); it++ )
86  {
87  strTmp << " " << (*it);
88  }
89 
90  return strTmp.str();
91 }
92 
93 
94 
95 namespace ossimplugins
96 {
97 
98  static bool readOneXmlNode(ossimRefPtr<ossimXmlDocument> xmlDocument,
99  ossimString xpath,
100  ossimString& nodeValue)
101  {
102  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
103 
104  xmlDocument->findNodes(xpath, xml_nodes);
105  if (xml_nodes.size() == 0)
106  {
107  if(traceDebug())
108  {
109  ossimNotify(ossimNotifyLevel_DEBUG) << " DEBUG:"
110  << "\nCould not find: " << xpath << std::endl;
111  }
112  return false;
113  }
114  if (xml_nodes.size() != 1)
115  {
116  if(traceDebug())
117  {
118  ossimNotify(ossimNotifyLevel_DEBUG) << " DEBUG:"
119  << "\nMore than one node value with " << xpath << std::endl;
120  }
121  return false;
122  }
123  nodeValue = xml_nodes[0]->getText();
124  return true;
125  }
126 
129  theDIMAPVersion(OSSIM_Spot6_UNKNOWN),
130  theMetadataSubProfile(OSSIM_Spot6_METADATA_SUBPROFILE_UNKNOWN),
131  theProductIsOk(false),
132  theRpcIsOk(false),
133  theXmlDocumentRoot(),
134 
135  theSensorID(),
136  theImageID(),
137  theProductionDate(),
138  theAcquisitionDate(),
139  theInstrument(),
140  theInstrumentIndex(),
141  theProcessingLevelString(),
142  theSpectralProcessingString(),
143 
144  theSunAzimuth(),
145  theSunElevation(),
146  theIncidenceAngle(),
147  theViewingAngle(),
148  theAzimuthAngle(),
149 
150  theImageSize(0, 0),
151  theTileSize(0, 0),
152  theNumberOfMegaTilesInRow(0),
153  theNumberOfMegaTilesInCol(0),
154  theNumberOfMegaTiles(0),
155  theMultiDataFile(),
156 
157  theNumBands(0),
158  theBandOrder(),
159 
160  thePhysicalBias(),
161  thePhysicalGain(),
162  theSolarIrradiance(),
163 
164  theUlCorner(),
165  theUrCorner(),
166  theLrCorner(),
167  theLlCorner(),
168 
169  theSpecId(),
170  theErrBias(0),
171  theErrBiasX(0),
172  theErrBiasY(0),
173  theErrRand(0),
174  theLineOffset(0),
175  theSampOffset(0),
176  theLatOffset(0),
177  theLonOffset(0),
178  theHeightOffset(0),
179  theLineScale(0),
180  theSampScale(0),
181  theLatScale(0),
182  theLonScale(0),
183  theHeightScale(0),
184  theLineNumCoeff(),
185  theLineDenCoeff(),
186  theSampNumCoeff(),
187  theSampDenCoeff(),
188 
189  theRefGroundPoint(0.0, 0.0, 0.0),
190  theRefImagePoint(0.0, 0.0)
191  {
192  }
193 
195  {
196  }
197 
198 
200  {
204  theProductIsOk = false;
205  theRpcIsOk = false;
206  theXmlDocumentRoot = "";
207  theImageID = "";
208  theSensorID="";
209  theProductionDate = "";
210  theAcquisitionDate = "";
211  theInstrument = "";
212  theInstrumentIndex = "";
215 
216  theSunAzimuth.clear();
217  theSunElevation.clear();
218  theIncidenceAngle.clear();
219  theViewingAngle.clear();
220  theAzimuthAngle.clear();
221 
227  ossimString msg = "";
228  theMultiDataFile.setBooleanValue(false, msg);
229 
230  theNumBands = 0;
231  theBandOrder.clear();
232 
233  thePhysicalBias.clear();
234  thePhysicalGain.clear();
235  theSolarIrradiance.clear();
236 
237  //---
238  // Corner points:
239  //---
244 
247 
248  //---
249  // RPC model parameters
250  //---
251  theErrBias = 0.0;
252  theErrBiasX = 0.0;
253  theErrBiasY = 0.0;
254  theErrRand = 0.0;
255  theLineOffset = 0;
256  theSampOffset = 0;
257  theLatOffset = 0.0;
258  theLonOffset = 0.0;
259  theHeightOffset = 0.0;
260  theLineScale = 0.0;
261  theSampScale = 0.0;
262  theLatScale = 0.0;
263  theLonScale = 0.0;
264  theHeightScale = 0.0;
265  theLineNumCoeff.clear();
266  theLineDenCoeff.clear();
267  theSampNumCoeff.clear();
268  theSampDenCoeff.clear();
269  theSpecId = "";
270  }
271 
273  {
274 
275  os << "\n----------------- Info on Spot6 Image -------------------"
276  << "\n "
277  << "\n Job Number (ID): " << theImageID
278  << "\n Acquisition Date: " << theAcquisitionDate
279  << "\n Instrument: " << theInstrument
280  << "\n Instrument Index: " << theInstrumentIndex
281  << "\n Production Date: " << theProductionDate
282  << "\n Processing Level: " << theProcessingLevelString
283  << "\n Spectral Processing: " << theSpectralProcessingString
284 
285  << "\n Number of Bands: " << theNumBands
286  << "\n Bands Display Order: " << getVectorStringAsString(theBandOrder)
287 
288  << "\n Image Size: " << theImageSize
289  << "\n Tile Size: " << theTileSize
290  << "\n Number Of Tiles (Row, Col): " << theNumberOfMegaTiles << " ("
291  << theNumberOfMegaTilesInRow << ", "
292  << theNumberOfMegaTilesInCol << ")"
293 
294  << "\n Incidence Angle (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theIncidenceAngle)
295  << "\n Viewing Angle (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theViewingAngle)
296  << "\n Azimuth Angle (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theAzimuthAngle)
297  << "\n Sun Azimuth (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theSunAzimuth)
298  << "\n Sun Elevation (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theSunElevation)
299 
300  << "\n Physical Bias (for each band): " << getVectorFloat64AsString(thePhysicalBias)
301  << "\n Physical Gain (for each band): " << getVectorFloat64AsString(thePhysicalGain)
302  << "\n Solar Irradiance (for each band): " << getVectorFloat64AsString(theSolarIrradiance)
303 
304  << "\n Geo Center Point: " << theRefGroundPoint
305  // TODO add RefImagePoint if necessary
306 
307  << "\n Corner Points:"
308  << "\n UL: " << theUlCorner
309  << "\n UR: " << theUrCorner
310  << "\n LR: " << theLrCorner
311  << "\n LL: " << theLlCorner
312  << "\n"
313 
314  << "\n RPC model parameters:"
315  << "\n RPC ID: " << theSpecId
316  << "\n SampNumCoeff: " << getVectorDoubleAsString(theSampNumCoeff)
317  << "\n SampDenCoeff: " << getVectorDoubleAsString(theSampDenCoeff)
318  << "\n LineNumCoeff: " << getVectorDoubleAsString(theLineNumCoeff)
319  << "\n LineDenCoeff: " << getVectorDoubleAsString(theLineDenCoeff)
320  << "\n LonScale: " << theLonScale
321  << "\n LonOffset: " << theLonOffset
322  << "\n LatScale: " << theLatScale
323  << "\n LonScale: " << theLonScale
324  << "\n HeightScale: " << theHeightScale
325  << "\n HeightOffset: " << theHeightOffset
326  << "\n SampScale: " << theSampScale
327  << "\n SampOffset: " << theSampOffset
328  << "\n LineScale: " << theLineScale
329  << "\n LineOffset: " << theLineOffset
330  << "\n theErrBias: " << theErrBias
331  << "\n theErrBiasX: " << theErrBiasX
332  << "\n theErrBiasY: " << theErrBiasY
333  << "\n theErrRand: " << theErrRand
334  << "\n"
335  << "\n---------------------------------------------------------"
336  << "\n " << std::endl;
337  }
338 
340  {
341  static const char MODULE[] = "ossimSpot6DimapSupportData::parseXmlFile";
342  //traceDebug.setTraceFlag(true);
343 
344  if(traceDebug())
345  {
346  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nFile: " << file << std::endl;
347  }
348 
349  if (allMetadataRead())
350  clearFields();
351 
352  //---
353  // Instantiate the file reading:
354  //---
355  ossim_int64 fileSize = file.fileSize();
356  std::ifstream in(file.c_str(), std::ios::binary|std::ios::in);
357  std::vector<char> fullBuffer;
358  ossimString bufferedIo;
359  if(in.good()&&(fileSize > 0))
360  {
361  char buf[100];
362  fullBuffer.resize(fileSize);
363  in.read(buf, std::min((ossim_int64)100, fileSize));
364  if(!in.fail())
365  {
366  ossimString testString = ossimString(buf,
367  buf + in.gcount());
368  if(testString.contains("xml"))
369  {
370  in.seekg(0);
371  in.read(&fullBuffer.front(), (std::streamsize)fullBuffer.size());
372  if(!in.fail())
373  {
374  bufferedIo = ossimString(fullBuffer.begin(),
375  fullBuffer.begin()+in.gcount());
376  }
377  }
378  }
379  }
380  else
381  {
382  return false;
383  }
384  //---
385  // Instantiate the XML parser:
386  //---
387  ossimRefPtr<ossimXmlDocument> xmlDocument;
388 
389  if(bufferedIo.empty())
390  {
391  xmlDocument = new ossimXmlDocument(file);
392  }
393  else
394  {
395  xmlDocument = new ossimXmlDocument;
396  std::istringstream inStringStream(bufferedIo.string());
397  if(!xmlDocument->read(inStringStream))
398  {
399  return false;
400  }
401  }
402  if (xmlDocument->getErrorStatus())
403  {
404  if(traceDebug())
405  {
407  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
408  << "\nUnable to parse xml file" << std::endl;
409  }
410  setErrorStatus();
411  return false;
412  }
413 
414  if (!parseMetadataIdentificationDIMAPv2(xmlDocument) )
415  {
416  if (traceDebug())
417  {
419  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
420  << "\nparseMetadataIdentification failed. Returning false"
421  << std::endl;
422  }
423  return false;
424  }
425 
426 
428  {
429  if (theProductIsOk)
430  clearFields();
431 
432  if (!parseDatasetIdentification(xmlDocument))
433  {
434  if (traceDebug())
435  {
437  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
438  << "\nparseDatasetdentification failed. Returning false" << std::endl;
439  }
440  return false;
441  }
442 
443  if (!parseDatasetContent(xmlDocument))
444  {
446  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
447  << "\nparseDatasetContent failed. Returning false" << std::endl;
448  return false;
449  }
450 
451  if (!parseProductInformation(xmlDocument))
452  {
453  if (traceDebug())
454  {
456  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
457  << "\nparseProductInformation failed. Returning false" << std::endl;
458  }
459  return false;
460  }
461 
462  if (!parseCoordinateReferenceSystem(xmlDocument))
463  {
464  if (traceDebug())
465  {
467  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
468  << "\nparseCoordinateReferenceSystem failed. Returning false" << std::endl;
469  }
470  return false;
471  }
472 
473  if (!parseGeoposition(xmlDocument))
474  {
475  if (traceDebug())
476  {
478  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
479  << "\nparseGeoposition failed. Returning false" << std::endl;
480  }
481  return false;
482  }
483 
484  if (!parseProcessingInformation(xmlDocument))
485  {
486  if (traceDebug())
487  {
489  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
490  << "\nparseProcessingInformation failed. Returning false" << std::endl;
491  }
492  return false;
493  }
494 
495  if (!parseRasterData(xmlDocument))
496  {
497  if (traceDebug())
498  {
500  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
501  << "\nparseRasterData failed. Returning false" << std::endl;
502  }
503  return false;
504  }
505 
506  if (!parseRadiometricData(xmlDocument))
507  {
509  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
510  << "\nparseRadiometricData failed. Returning false" << std::endl;
511  return false;
512  }
513 
514  if (!parseGeometricData(xmlDocument))
515  {
517  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
518  << "\nparseGeometricData failed. Returning false" << std::endl;
519  return false;
520  }
521 
522  if (!parseQualityAssessment(xmlDocument))
523  {
525  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
526  << "\nparseQualityAssessment failed. Returning false" << std::endl;
527  return false;
528  }
529 
530  if (!parseDatasetSources(xmlDocument))
531  {
533  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
534  << "\nparseDatasetSources failed. Returning false" << std::endl;
535  return false;
536  }
537 
538  theProductIsOk = true;
539  }
540 
542  {
543  // Parse RPC file
544  if (theProcessingLevelString == "SENSOR")
545  {
546  if (parseRPCMetadata(xmlDocument) == false)
547  {
549  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
550  << "\nparseRPCMetadata initialization failed. Returning false" << std::endl;
551  return false;
552  }
553  theRpcIsOk = true;
554  }
555  else
556  theRpcIsOk = true;
557  }
558 
559  if (theProcessingLevelString != "SENSOR")
560  theRpcIsOk = true;
561 
562  if (traceDebug() && allMetadataRead())
563  {
565  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: exited..." << std::endl;
566  }
567 
568  return true;
569  }
570 
572  {
574  }
575 
577  {
578  return theSensorID;
579  }
580 
582  {
583  return theAcquisitionDate;
584  }
585 
587  {
588  return theProductionDate;
589  }
590 
592  {
593  return theImageID;
594  }
595 
597  {
598  return theInstrument;
599  }
600 
602  {
603  return theInstrumentIndex;
604  }
605 
606  void ossimSpot6DimapSupportData::getSunAzimuth(std::vector<ossim_float64>& az) const
607  {
608  az = theSunAzimuth;
609  }
610 
611  void ossimSpot6DimapSupportData::getSunElevation(std::vector<ossim_float64>& el) const
612  {
613  el = theSunElevation;
614  }
615 
617  {
618  sz = theImageSize;
619  }
620 
622  {
623  return theNumBands;
624  }
625 
626  void ossimSpot6DimapSupportData::getIncidenceAngle(std::vector<ossim_float64>& ia) const
627  {
628  ia = theIncidenceAngle;
629  }
630 
631  void ossimSpot6DimapSupportData::getViewingAngle(std::vector<ossim_float64>& va) const
632  {
633  va = theViewingAngle;
634  }
635 
637  {
638  gp = theRefGroundPoint;
639  }
640 
642  {
643  rp = theRefImagePoint;
644  }
645 
647  {
648  pt = theUlCorner;
649  }
650 
652  {
653  pt = theUrCorner;
654  }
655 
657  {
658  pt = theLrCorner;
659  }
660 
662  {
663  pt = theLlCorner;
664  }
665 
667  {
668  rect = ossimDrect(0.0, 0.0, theImageSize.x-1.0, theImageSize.y-1.0);
669  }
670 
671 
673  const char* prefix)const
674  {
675  ossimString tempString;
676  ossim_uint32 idx = 0;
677 
678  kwl.add(prefix,
680  "ossimSpot6DimapSupportData",
681  true);
682 
683  tempString = "";
684  for(idx = 0; idx < theSunAzimuth.size(); ++idx)
685  {
686  tempString += (ossimString::toString(theSunAzimuth[idx]) + " ");
687  }
688 
689  kwl.add(prefix,
691  tempString,
692  true);
693 
694  kwl.add(prefix,
695  "number_of_azimuth_angle",
696  static_cast<ossim_uint32>(theSunAzimuth.size()),
697  true);
698 
699  tempString = "";
700  for(idx = 0; idx < theSunElevation.size(); ++idx)
701  {
702  tempString += (ossimString::toString(theSunElevation[idx]) + " ");
703  }
704 
705  kwl.add(prefix,
707  tempString,
708  true);
709 
710  kwl.add(prefix,
711  "number_of_elevation_angle",
712  static_cast<ossim_uint32>(theSunElevation.size()),
713  true);
714 
715  //---
716  // Note: since this is a new keyword, use the point.toString as there is
717  // no backwards compatibility issues.
718  //---
719 
720  kwl.add(prefix,
721  "image_size",
724  true);
725 
726  kwl.add(prefix,
727  "reference_ground_point",
732  true);
733 
734  kwl.add(prefix,
735  "reference_image_point",
738  true);
739 
740  kwl.add(prefix,
742  theNumBands,
743  true);
744 
745  tempString = "";
746  for(idx = 0; idx < theBandOrder.size(); ++idx)
747  {
748  tempString += (theBandOrder[idx] + " ");
749  }
750 
751  kwl.add(prefix,
752  "band_name_list",
753  tempString,
754  true);
755 
756  kwl.add(prefix,
757  "image_id",
758  theImageID,
759  true);
760 
761  kwl.add(prefix,
762  "processing_level",
764  true);
765 
766  kwl.add(prefix,
767  "instrument",
769  true);
770 
771  kwl.add(prefix,
772  "instrument_index",
774  true);
775 
776  kwl.add(prefix,
779  true);
780 
781  kwl.add(prefix,
782  "production_date",
784  true);
785 
786  tempString = "";
787  for(idx = 0; idx < theIncidenceAngle.size(); ++idx)
788  {
789  tempString += (ossimString::toString(theIncidenceAngle[idx]) + " ");
790  }
791 
792  kwl.add(prefix,
793  "incident_angle",
794  tempString,
795  true);
796 
797  kwl.add(prefix,
798  "number_of_incident_angle",
799  static_cast<ossim_uint32>(theIncidenceAngle.size()),
800  true);
801 
802  tempString = "";
803  for(idx = 0; idx < theViewingAngle.size(); ++idx)
804  {
805  tempString += (ossimString::toString(theViewingAngle[idx]) + " ");
806  }
807 
808  kwl.add(prefix,
809  "viewing_angle",
810  tempString,
811  true);
812 
813  kwl.add(prefix,
814  "number_of_viewing_angle",
815  static_cast<ossim_uint32>(theViewingAngle.size()),
816  true);
817 
818  tempString = "";
819  for(idx = 0; idx < theAzimuthAngle.size(); ++idx)
820  {
821  tempString += (ossimString::toString(theAzimuthAngle[idx]) + " ");
822  }
823 
824  kwl.add(prefix,
825  "scene_orientation",
826  tempString,
827  true);
828 
829  kwl.add(prefix,
830  "number_of_scene_orientation",
831  static_cast<ossim_uint32>(theAzimuthAngle.size()),
832  true);
833 
834  kwl.add(prefix,
835  "ul_ground_point",
839  theUlCorner.datum()->code(),
840  true);
841 
842  kwl.add(prefix,
843  "ur_ground_point",
847  theUrCorner.datum()->code(),
848  true);
849 
850  kwl.add(prefix,
851  "lr_ground_point",
855  theLrCorner.datum()->code(),
856  true);
857 
858  kwl.add(prefix,
859  "ll_ground_point",
863  theLlCorner.datum()->code(),
864  true);
865 
866  kwl.add(prefix,
867  "sensorID",
868  theSensorID,
869  true);
870 
871 
872  tempString = "";
873  for(idx = 0; idx < thePhysicalBias.size(); ++idx)
874  {
875  tempString += (ossimString::toString(thePhysicalBias[idx]) + " ");
876  }
877  kwl.add(prefix,
878  "physical_bias",
879  tempString,
880  true);
881 
882  tempString = "";
883  for(idx = 0; idx < thePhysicalGain.size(); ++idx)
884  {
885  tempString += (ossimString::toString(thePhysicalGain[idx]) + " ");
886  }
887  kwl.add(prefix,
888  "physical_gain",
889  tempString,
890  true);
891 
892  tempString = "";
893  for(idx = 0; idx < theSolarIrradiance.size(); ++idx)
894  {
895  tempString += (ossimString::toString(theSolarIrradiance[idx]) + " ");
896  }
897 
898  kwl.add(prefix,
899  "solar_irradiance",
900  tempString,
901  true);
902 
903  return true;
904  }
905 
907  const char* prefix)
908  {
909  ossim_uint32 idx = 0;
910  ossim_uint32 total;
911  ossimString tempString;
912 
913  clearFields();
914 
915 
916  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
917 
918  if(type != "ossimSpot6DimapSupportData")
919  {
920  return false;
921  }
922 
923  total = ossimString(kwl.find(prefix,"number_of_azimuth_angle")).toUInt32();
924  theSunAzimuth.resize(total);
925  tempString = kwl.find(prefix,ossimKeywordNames::AZIMUTH_ANGLE_KW);
926  if(tempString != "")
927  {
928  std::istringstream in(tempString.string());
929  ossimString tempValue;
930  for(idx = 0; idx < theSunAzimuth.size();++idx)
931  {
932  in >> tempValue.string();
933  theSunAzimuth[idx] = tempValue.toDouble();
934  }
935  }
936 
937  total = ossimString(kwl.find(prefix,"number_of_elevation_angle")).toUInt32();
938  theSunElevation.resize(total);
939  tempString = kwl.find(prefix,ossimKeywordNames::ELEVATION_ANGLE_KW);
940  if(tempString != "")
941  {
942  std::istringstream in(tempString.string());
943  ossimString tempValue;
944  for(idx = 0; idx < theSunElevation.size();++idx)
945  {
946  in >> tempValue.string();
947  theSunElevation[idx] = tempValue.toDouble();
948  }
949  }
950 
951  theImageSize = createIpt(kwl.find(prefix, "image_size"));
952  theRefGroundPoint = createGround(kwl.find(prefix, "reference_ground_point"));
953  theRefImagePoint = createDpt(kwl.find(prefix, "reference_image_point"));
954 
956 
957  theBandOrder.resize(theNumBands);
958  tempString = kwl.find(prefix,"band_name_list");
959  if(tempString != "")
960  {
961  std::istringstream in(tempString.string());
962  ossimString tempValue;
963  for(idx = 0; idx < theBandOrder.size();++idx)
964  {
965  in >> tempValue.string();
966  theBandOrder[idx] = tempValue;
967  }
968  }
969 
971  theProductionDate = kwl.find(prefix, "production_date");
972  theImageID = kwl.find(prefix, "image_id");
973  theInstrument = kwl.find(prefix, "instrument");
974  theInstrumentIndex = kwl.find(prefix, "instrument_index");
975 
976  total = ossimString(kwl.find(prefix,"number_of_incident_angle")).toUInt32();
977  theIncidenceAngle.resize(total);
978  tempString = kwl.find(prefix,"incident_angle");
979  if(tempString != "")
980  {
981  std::istringstream in(tempString.string());
982  ossimString tempValue;
983  for(idx = 0; idx < theIncidenceAngle.size();++idx)
984  {
985  in >> tempValue.string();
986  theIncidenceAngle[idx] = tempValue.toDouble();
987  }
988  }
989 
990  total = ossimString(kwl.find(prefix,"number_of_viewing_angle")).toUInt32();
991  theViewingAngle.resize(total);
992  tempString = kwl.find(prefix,"viewing_angle");
993  if(tempString != "")
994  {
995  std::istringstream in(tempString.string());
996  ossimString tempValue;
997  for(idx = 0; idx < theViewingAngle.size();++idx)
998  {
999  in >> tempValue.string();
1000  theViewingAngle[idx] = tempValue.toDouble();
1001  }
1002  }
1003 
1004  total = ossimString(kwl.find(prefix,"number_of_scene_orientation")).toUInt32();
1005  theAzimuthAngle.resize(total);
1006  tempString = kwl.find(prefix,"scene_orientation");
1007  if(tempString != "")
1008  {
1009  std::istringstream in(tempString.string());
1010  ossimString tempValue;
1011  for(idx = 0; idx < theAzimuthAngle.size();++idx)
1012  {
1013  in >> tempValue.string();
1014  theAzimuthAngle[idx] = tempValue.toDouble();
1015  }
1016  }
1017 
1018 
1019  theUlCorner =createGround( kwl.find(prefix, "ul_ground_point"));
1020  theUrCorner =createGround( kwl.find(prefix, "ur_ground_point"));
1021  theLrCorner =createGround( kwl.find(prefix, "lr_ground_point"));
1022  theLlCorner =createGround( kwl.find(prefix, "ll_ground_point"));
1023 
1024  theSensorID = ossimString(kwl.find(prefix, "sensorID"));
1025 
1026  theProcessingLevelString = ossimString(kwl.find(prefix, "processing_level"));
1027 
1028  thePhysicalBias.resize(theNumBands);
1029  tempString = kwl.find(prefix,"physical_bias");
1030  if(tempString != "")
1031  {
1032  std::istringstream in(tempString.string());
1033  ossimString tempValue;
1034  for(idx = 0; idx < thePhysicalBias.size();++idx)
1035  {
1036  in >> tempValue.string();
1037  thePhysicalBias[idx] = tempValue.toDouble();
1038  }
1039  }
1040 
1041  thePhysicalGain.resize(theNumBands);
1042  tempString = kwl.find(prefix,"physical_gain");
1043  if(tempString != "")
1044  {
1045  std::istringstream in(tempString.string());
1046  ossimString tempValue;
1047  for(idx = 0; idx < thePhysicalGain.size();++idx)
1048  {
1049  in >> tempValue.string();
1050  thePhysicalGain[idx] = tempValue.toDouble();
1051  }
1052  }
1053 
1055  tempString = kwl.find(prefix,"solar_irradiance");
1056  if(tempString != "")
1057  {
1058  std::istringstream in(tempString.string());
1059  ossimString tempValue;
1060  for(idx = 0; idx < theSolarIrradiance.size();++idx)
1061  {
1062  in >> tempValue.string();
1063  theSolarIrradiance[idx] = tempValue.toDouble();
1064  }
1065  }
1066 
1067  return true;
1068  }
1069 
1071  {
1072  std::istringstream in(s.string());
1073  ossimString lat, lon, height;
1074  ossimString code;
1075 
1076  in >> lat.string() >> lon.string() >> height.string() >> code.string();
1077 
1078  return ossimGpt(lat.toDouble(),
1079  lon.toDouble(),
1080  height.toDouble(),
1082 
1083  }
1084 
1086  {
1087  std::istringstream in(s.string());
1088  ossimString x, y;
1089  ossimString code;
1090 
1091  in >> x.string() >> y.string();
1092 
1093  return ossimDpt(x.toDouble(), y.toDouble());
1094 
1095  }
1096 
1098  {
1099  std::istringstream in(s.string());
1100  ossimString x, y;
1101  ossimString code;
1102 
1103  in >> x.string() >> y.string();
1104 
1105  return ossimIpt(x.toInt(), y.toInt());
1106 
1107  }
1108 
1110  ossimRefPtr<ossimXmlDocument> xmlDocument)
1111  {
1112  ossimString xpath;
1113  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1114 
1115  //---
1116  // Fetch the Image ID:
1117  //---
1118  xpath = "/Product_Information/Delivery_Identification/JOB_ID"; //DIMAPv2
1119  xpath = theXmlDocumentRoot + xpath;
1120  if (!readOneXmlNode(xmlDocument, xpath, theImageID))
1121  {
1122  return false;
1123  }
1124 
1125  //---
1126  // Fetch the ProductionDate:
1127  //---
1128  xpath = "/Product_Information/Delivery_Identification/PRODUCTION_DATE"; //DIMAPv2
1129  xpath = theXmlDocumentRoot + xpath;
1130  if (!readOneXmlNode(xmlDocument, xpath, theProductionDate))
1131  {
1132  return false;
1133  }
1134 
1135  return true;
1136  }
1137 
1139  ossimRefPtr<ossimXmlDocument> xmlDocument)
1140  {
1141  ossimString xpath, nodeValue;
1142  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1143 
1144  //---
1145  // Corner points:
1146  //---
1147  xml_nodes.clear();
1148  xpath = "/Dataset_Content/Dataset_Extent/Vertex";
1149  xpath = theXmlDocumentRoot + xpath;
1150  xmlDocument->findNodes(xpath, xml_nodes);
1151  if (xml_nodes.size() != 4)
1152  {
1153  setErrorStatus();
1154  return false;
1155  }
1156  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node = xml_nodes.begin();
1157  while (node != xml_nodes.end())
1158  {
1159  ossimGpt gpt;
1160  ossimDpt ipt;
1161 
1162  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
1163  xpath = "LAT";
1164  (*node)->findChildNodes(xpath, sub_nodes);
1165  if (sub_nodes.size() == 0)
1166  {
1167  setErrorStatus();
1168  return false;
1169  }
1170  gpt.lat = sub_nodes[0]->getText().toDouble();
1171 
1172  sub_nodes.clear();
1173  xpath = "LON";
1174  (*node)->findChildNodes(xpath, sub_nodes);
1175  if (sub_nodes.size() == 0)
1176  {
1177  setErrorStatus();
1178  return false;
1179  }
1180  gpt.lon = sub_nodes[0]->getText().toDouble();
1181  gpt.hgt = 0.0; // assumed
1182 
1183  sub_nodes.clear();
1184  xpath = "ROW";
1185  (*node)->findChildNodes(xpath, sub_nodes);
1186  if (sub_nodes.size() == 0)
1187  {
1188  setErrorStatus();
1189  return false;
1190  }
1191  ipt.line = sub_nodes[0]->getText().toDouble() - 1.0;
1192 
1193  sub_nodes.clear();
1194  xpath = "COL";
1195  (*node)->findChildNodes(xpath, sub_nodes);
1196  if (sub_nodes.size() == 0)
1197  {
1198  setErrorStatus();
1199  return false;
1200  }
1201  ipt.samp = sub_nodes[0]->getText().toDouble() - 1.0;
1202 
1203  if (ipt.line < 1.0)
1204  if (ipt.samp < 1.0)
1205  theUlCorner = gpt;
1206  else
1207  theUrCorner = gpt;
1208  else
1209  if (ipt.samp < 1.0)
1210  theLlCorner = gpt;
1211  else
1212  theLrCorner = gpt;
1213 
1214  ++node;
1215  }
1216 
1217 
1218 
1219  //---
1220  // Center of frame.
1221  //---
1222  theRefGroundPoint.hgt = 0.0; // TODO needs to be looked up
1223 
1224  if (!readOneXmlNode(xmlDocument,
1225  theXmlDocumentRoot + "/Dataset_Content/Dataset_Extent/Center/LON", // DIMAPv2
1226  nodeValue))
1227  {
1228  return false;
1229  }
1230  theRefGroundPoint.lon = nodeValue.toDouble();
1231 
1232  if (!readOneXmlNode(xmlDocument, theXmlDocumentRoot + "/Dataset_Content/Dataset_Extent/Center/LAT", nodeValue)) // DIMAPv2
1233  {
1234  return false;
1235  }
1236  theRefGroundPoint.lat = nodeValue.toDouble();
1237 
1238  return true;
1239  }
1240 
1242  ossimRefPtr<ossimXmlDocument> xmlDocument)
1243  {
1244  ossimString xpath;
1245  std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1246  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
1247  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
1248 
1249  //---
1250  // Fetch the gain and bias for each spectral band:
1251  //---
1252  thePhysicalGain.assign(theNumBands, 1.000);
1253  thePhysicalBias.assign(theNumBands, 0.000);
1254 
1255  xml_nodes.clear();
1256  xpath = "/Radiometric_Data/Radiometric_Calibration/Instrument_Calibration/Band_Measurement_List/Band_Radiance"; //DIMAPv2
1257  xpath = theXmlDocumentRoot + xpath;
1258  xmlDocument->findNodes(xpath, xml_nodes);
1259 
1260  node = xml_nodes.begin();
1261  while (node != xml_nodes.end())
1262  {
1263  sub_nodes.clear();
1264  xpath = "BAND_ID";
1265  (*node)->findChildNodes(xpath, sub_nodes);
1266  if (sub_nodes.size() == 0)
1267  {
1268  setErrorStatus();
1269  return false;
1270  }
1271 
1272  ossimString bandName = sub_nodes[0]->getText();
1273  ossim_uint32 bandIndex = 0;
1274  if ( (theNumBands == 1) || (bandName == "B0") || (bandName == "P") )
1275  {
1276  bandIndex = 0;
1277  }
1278  else if (bandName == "B1")
1279  {
1280  bandIndex = 1;
1281  }
1282  else if (bandName == "B2")
1283  {
1284  bandIndex = 2;
1285  }
1286  else if (bandName == "B3")
1287  {
1288  bandIndex = 3;
1289  }
1290  else
1291  {
1293  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band ID is incorrect\n";
1294  }
1295 
1296  if ((bandIndex >= theNumBands ) )
1297  {
1299  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band index outside of range\n";
1300  return false;
1301  }
1302 
1303  sub_nodes.clear();
1304  xpath = "BIAS"; //DIMAPv2
1305  (*node)->findChildNodes(xpath, sub_nodes);
1306  if (sub_nodes.size() == 0)
1307  {
1308  setErrorStatus();
1309  return false;
1310  }
1311  thePhysicalBias[bandIndex] = sub_nodes[0]->getText().toDouble();
1312 
1313  sub_nodes.clear();
1314  xpath = "GAIN"; //DIMAPv2
1315  (*node)->findChildNodes(xpath, sub_nodes);
1316  if (sub_nodes.size() == 0)
1317  {
1318  setErrorStatus();
1319  return false;
1320  }
1321  thePhysicalGain[bandIndex] = sub_nodes[0]->getText().toDouble();
1322 
1323  ++node;
1324  }
1325 
1326  // Initialize to 999 : we find this value in some DIMAPv2 file
1327  // and there is no such tag in DIMAPv1 file
1328  theSolarIrradiance.assign(theNumBands, 999.000);
1329 
1330  xml_nodes.clear();
1331  xpath = "/Radiometric_Data/Radiometric_Calibration/Instrument_Calibration/Band_Measurement_List/Band_Solar_Irradiance";
1332  xpath = theXmlDocumentRoot + xpath;
1333  xmlDocument->findNodes(xpath, xml_nodes);
1334 
1335  node = xml_nodes.begin();
1336  while (node != xml_nodes.end())
1337  {
1338  sub_nodes.clear();
1339  xpath = "BAND_ID";
1340  (*node)->findChildNodes(xpath, sub_nodes);
1341  if (sub_nodes.size() == 0)
1342  {
1343  setErrorStatus();
1344  return false;
1345  }
1346 
1347  ossimString bandName = sub_nodes[0]->getText();
1348  ossim_uint32 bandIndex = 0;
1349  if ( (theNumBands == 1) || (bandName == "B0") || (bandName == "P") )
1350  {
1351  bandIndex = 0;
1352  }
1353  else if (bandName == "B1")
1354  {
1355  bandIndex = 1;
1356  }
1357  else if (bandName == "B2")
1358  {
1359  bandIndex = 2;
1360  }
1361  else if (bandName == "B3")
1362  {
1363  bandIndex = 3;
1364  }
1365  else
1366  {
1368  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band ID is incorrect\n";
1369  }
1370 
1371  if ((bandIndex >= theNumBands))
1372  {
1374  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band index outside of range 2\n";
1375  return false;
1376  }
1377 
1378  sub_nodes.clear();
1379  xpath = "VALUE";
1380  (*node)->findChildNodes(xpath, sub_nodes);
1381  if (sub_nodes.size() == 0)
1382  {
1383  setErrorStatus();
1384  return false;
1385  }
1386  theSolarIrradiance[bandIndex] = sub_nodes[0]->getText().toDouble();
1387 
1388  ++node;
1389  }
1390 
1391  return true;
1392  }
1393 
1394 
1396  ossimRefPtr<ossimXmlDocument> xmlDocument)
1397  {
1398  static const char MODULE[] = "ossimSpot6DimapSupportData::parseRPCMetadata";
1399  ossimString xpath, nodeValue;
1400  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1401 
1402  //---
1403  // Fetch the Global RFM - Direct Model - Bias:
1404  //---
1405  xpath = "/Rational_Function_Model/Resource_Reference/RESOURCE_ID"; //DIMAPv2
1406  xpath = theXmlDocumentRoot + xpath;
1407  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1408  {
1409  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: Could not find: " << xpath << std::endl;
1410  return false;
1411  }
1412  theSpecId = nodeValue;
1413 
1414  //---
1415  // Fetch the Global RFM - Inverse Model:
1416  //---
1417  xml_nodes.clear();
1418  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model"; //DIMAPv2
1419  xpath = theXmlDocumentRoot + xpath;
1420  xmlDocument->findNodes(xpath, xml_nodes);
1421  if (xml_nodes.empty())
1422  {
1423  setErrorStatus();
1424  if(traceDebug())
1425  {
1426  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: Could not find: " << xpath << std::endl;
1427  }
1428  return false;
1429  }
1430 
1431  for (ossim_uint32 it = 1; it < 21; it ++)
1432  {
1433  std::ostringstream valueStr;
1434  valueStr << it;
1435 
1436  xml_nodes.clear();
1437  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/LINE_NUM_COEFF_"; //DIMAPv2
1438  xpath = theXmlDocumentRoot + xpath;
1439  xpath = xpath + valueStr.str();
1440  xmlDocument->findNodes(xpath, xml_nodes);
1441  if (xml_nodes.size() == 0)
1442  {
1443  setErrorStatus();
1444  if(traceDebug())
1445  {
1446  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1447  }
1448  return false;
1449  }
1450  theLineNumCoeff.push_back(xml_nodes[0]->getText().toDouble());
1451 
1452  xml_nodes.clear();
1453  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/LINE_DEN_COEFF_"; //DIMAPv2
1454  xpath = theXmlDocumentRoot + xpath;
1455  xpath = xpath + valueStr.str();
1456  xmlDocument->findNodes(xpath, xml_nodes);
1457  if (xml_nodes.size() == 0)
1458  {
1459  setErrorStatus();
1460  if(traceDebug())
1461  {
1462  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1463  }
1464  return false;
1465  }
1466  theLineDenCoeff.push_back(xml_nodes[0]->getText().toDouble());
1467 
1468  xml_nodes.clear();
1469  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/SAMP_NUM_COEFF_"; //DIMAPv2
1470  xpath = theXmlDocumentRoot + xpath;
1471  xpath = xpath + valueStr.str();
1472  xmlDocument->findNodes(xpath, xml_nodes);
1473  if (xml_nodes.size() == 0)
1474  {
1475  setErrorStatus();
1476  if(traceDebug())
1477  {
1478  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1479  }
1480  return false;
1481  }
1482  theSampNumCoeff.push_back(xml_nodes[0]->getText().toDouble());
1483 
1484  xml_nodes.clear();
1485  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/SAMP_DEN_COEFF_"; //DIMAPv2
1486  xpath = theXmlDocumentRoot + xpath;
1487  xpath = xpath + valueStr.str();
1488  xmlDocument->findNodes(xpath, xml_nodes);
1489  if (xml_nodes.size() == 0)
1490  {
1491  setErrorStatus();
1492  if(traceDebug())
1493  {
1494  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1495  }
1496  return false;
1497  }
1498  theSampDenCoeff.push_back(xml_nodes[0]->getText().toDouble());
1499  }
1500 
1501 
1502  //---
1503  // Fetch the Global RFM - Inverse Model - Bias:
1504  //---
1505  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/ERR_BIAS_ROW"; //DIMAPv2
1506  xpath = theXmlDocumentRoot + xpath;
1507  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1508  {
1509  return false;
1510  }
1511  theErrBiasX = nodeValue.toDouble();
1512  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/ERR_BIAS_COL"; //DIMAPv2
1513  xpath = theXmlDocumentRoot + xpath;
1514  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1515  {
1516  return false;
1517  }
1518  theErrBiasY = nodeValue.toDouble();
1519 
1520  //---
1521  // Fetch the Global RFM validity parameters :
1522  //---
1523 
1524  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LONG_SCALE"; //DIMAPv2
1525  xpath = theXmlDocumentRoot + xpath;
1526  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1527  {
1528  return false;
1529  }
1530  theLonScale = nodeValue.toDouble();
1531 
1532  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LONG_OFF"; //DIMAPv2
1533  xpath = theXmlDocumentRoot + xpath;
1534  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1535  {
1536  return false;
1537  }
1538  theLonOffset = nodeValue.toDouble();
1539 
1540  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LAT_SCALE"; //DIMAPv2
1541  xpath = theXmlDocumentRoot + xpath;
1542  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1543  {
1544  return false;
1545  }
1546  theLatScale = nodeValue.toDouble();
1547 
1548  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LAT_OFF"; //DIMAPv2
1549  xpath = theXmlDocumentRoot + xpath;
1550  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1551  {
1552  return false;
1553  }
1554  theLatOffset = nodeValue.toDouble();
1555 
1556  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/HEIGHT_SCALE";
1557  xpath = theXmlDocumentRoot + xpath;
1558  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1559  {
1560  return false;
1561  }
1562  theHeightScale = nodeValue.toDouble();
1563 
1564  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/HEIGHT_OFF"; //DIMAPv2
1565  xpath = theXmlDocumentRoot + xpath;
1566  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1567  {
1568  return false;
1569  }
1570  theHeightOffset = nodeValue.toDouble();
1571 
1572  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/SAMP_SCALE"; //DIMAPv2
1573  xpath = theXmlDocumentRoot + xpath;
1574  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1575  {
1576  return false;
1577  }
1578  theSampScale = nodeValue.toDouble();
1579 
1580  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/SAMP_OFF"; //DIMAPv2
1581  xpath = theXmlDocumentRoot + xpath;
1582  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1583  {
1584  return false;
1585  }
1586  theSampOffset = nodeValue.toInt32();
1587 
1588  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LINE_SCALE"; //DIMAPv2
1589  xpath = theXmlDocumentRoot + xpath;
1590  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1591  {
1592  return false;
1593  }
1594  theLineScale = nodeValue.toDouble();
1595 
1596  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LINE_OFF"; //DIMAPv2
1597  xpath = theXmlDocumentRoot + xpath;
1598  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1599  {
1600  return false;
1601  }
1602  theLineOffset = nodeValue.toInt32();
1603 
1604  return true;
1605  }
1606 
1608  {
1609  // static const char MODULE[] = "ossimSpot6DimapSupportData::parseMetadataIdentification";
1610 
1611  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1612  ossimString xpath, nodeValue;
1613  theXmlDocumentRoot = "/DIMAP_Document";
1614 
1615  //---
1616  // Get the version string which can be used as a key for parsing.
1617  //---
1618  xml_nodes.clear();
1619  xpath = "/Metadata_Identification/METADATA_FORMAT";
1620  xpath = theXmlDocumentRoot + xpath;
1621  xmlDocument->findNodes(xpath, xml_nodes);
1622  if (xml_nodes.size() == 0)
1623  {
1624 
1625  // FIXME MSD: used to support Spot6/Pleiades samples from SPOT-IMAGES website which are not coherent
1626  // with the specification (28/09/2012). Should be remove when first data will be available and sample
1627  // replaced.
1628  theXmlDocumentRoot = "/SPOT_DIMAP_Document";
1629  if (traceDebug())
1630  {
1631  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nTry to use the old root: " << theXmlDocumentRoot << endl;
1632  }
1633 
1634  xml_nodes.clear();
1635  xpath = "/Metadata_Identification/METADATA_FORMAT";
1636  xpath = theXmlDocumentRoot + xpath;
1637  xmlDocument->findNodes(xpath, xml_nodes);
1638  if (xml_nodes.size() == 0)
1639  {
1640  // FIXME MSD: used to support spot6/peiades samples from SPOT-IMAGES website which are not coherent
1641  // with the specification (28/09/2012). Should be remove when first data will be available and sample
1642  // replaced.
1643  theXmlDocumentRoot = "/Dimap_Document";
1644  if (traceDebug())
1645  {
1646  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nTry to use the new root: " << theXmlDocumentRoot << endl;
1647  }
1648 
1649  xml_nodes.clear();
1650  xpath = "/Metadata_Identification/METADATA_FORMAT";
1651  xpath = theXmlDocumentRoot + xpath;
1652  xmlDocument->findNodes(xpath, xml_nodes);
1653  if (xml_nodes.size() == 0)
1654  {
1655  setErrorStatus();
1656  if (traceDebug())
1657  {
1658  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << endl;
1659  }
1660  return false;
1661  }
1662  }
1663  }
1664 
1665  ossimString attribute = "version";
1666  ossimString value;
1667  xml_nodes[0]->getAttributeValue(value, attribute);
1668  if (value != "2.0")
1669  {
1670  setErrorStatus();
1671  if (traceDebug())
1672  {
1674  << "WARNING: DIMAP metadata version is not correct!" << std::endl;
1675  }
1676  return false;
1677  }
1678 
1679  //---
1680  // Check that it is a valid SPOT DIMAPv2 file
1681  //---
1682  xpath = "/Metadata_Identification/METADATA_PROFILE";
1683  xpath = theXmlDocumentRoot + xpath;
1684  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1685  {
1686  return false;
1687  }
1688 
1689  ossimString metadataProfile;
1690  if ( (nodeValue != "S6_SENSOR")
1691  && (nodeValue != "S6_ORTHO")
1692  && (nodeValue != "S6_MOSAIC") )
1693  {
1694  if (traceDebug())
1695  {
1697  << "DEBUG:\n Not a Spot6 DIMAPv2 file: metadata profile is incorrect!" << std::endl;
1698  }
1699  return false;
1700  }
1701  else
1702  metadataProfile = nodeValue;
1703 
1704  //---
1705  // Get the subprofile
1706  //---
1707  xpath = "/Metadata_Identification/METADATA_SUBPROFILE";
1708  xpath = theXmlDocumentRoot + xpath;
1709  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1710  {
1711  return false;
1712  }
1713 
1714  if ((nodeValue == "PRODUCT"))
1716  else if ( (nodeValue == "RPC") && (metadataProfile == "S6_SENSOR") )
1718  else
1719  {
1721  if (traceDebug())
1722  {
1724  << "DEBUG:\n Not a Spot6 DIMAPv2 file: metadata subprofile is incorrect !" << std::endl;
1725  }
1726  return false;
1727  }
1728 
1730 
1731  return true;
1732  }
1733 
1735  ossimRefPtr<ossimXmlDocument> /* xmlDocument */ )
1736  {
1737  return true;
1738  }
1739 
1741  ossimRefPtr<ossimXmlDocument> /* xmlDocument */ )
1742  {
1743  return true;
1744  }
1745 
1747  ossimRefPtr<ossimXmlDocument> /* xmlDocument */ )
1748  {
1749  return true;
1750  }
1751 
1753  {
1754  // static const char MODULE[] = "ossimSpot6DimapSupportData::parseProcessingInformation";
1755 
1756  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1757  ossimString xpath, nodeValue;
1758 
1759  //---
1760  // Fetch the Processing Level:
1761  //---
1762  xpath = "/Processing_Information/Product_Settings/PROCESSING_LEVEL"; //DIMAPv2
1763  xpath = theXmlDocumentRoot + xpath;
1764  if (!readOneXmlNode(xmlDocument, xpath, theProcessingLevelString))
1765  {
1766  return false;
1767  }
1768 
1769  //---
1770  // Fetch the Spectral Processing:
1771  //---
1772  xpath = "/Processing_Information/Product_Settings/PROCESSING_LEVEL"; //DIMAPv2
1773  xpath = theXmlDocumentRoot + xpath;
1774  if (!readOneXmlNode(xmlDocument, xpath, theSpectralProcessingString))
1775  {
1776  return false;
1777  }
1778 
1779  return true;
1780  }
1781 
1783  {
1784  static const char MODULE[] = "ossimSpot6DimapSupportData::parseRasterData";
1785  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1786  ossimString xpath, nodeValue;
1787  //---
1788  // Fetch if the product file is linked to one or many JP2 files:
1789  //---
1790  xpath = "/Raster_Data/Data_Access/DATA_FILE_TILES"; //DIMAPv2
1791  xpath = theXmlDocumentRoot + xpath;
1792  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1793  {
1794  return false;
1795  }
1796  theMultiDataFile.setValue(nodeValue);
1797 
1798  //---
1799  // Fetch the MegaImageSize:
1800  //---
1801  xpath = "/Raster_Data/Raster_Dimensions/NCOLS"; //DIMAPv2
1802  xpath = theXmlDocumentRoot + xpath;
1803  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1804  {
1805  return false;
1806  }
1807  theImageSize.samp = nodeValue.toInt();
1808 
1809  xpath = "/Raster_Data/Raster_Dimensions/NROWS"; //DIMAPv2
1810  xpath = theXmlDocumentRoot + xpath;
1811  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1812  {
1813  return false;
1814  }
1815  theImageSize.line = nodeValue.toInt();
1816 
1818  {
1819  //---
1820  // Fetch the Number of MegaTiles:
1821  //---
1822  xpath = "/Raster_Data/Raster_Dimensions/Tile_Set/NTILES"; //DIMAPv2
1823  xpath = theXmlDocumentRoot + xpath;
1824  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1825  {
1826  return false;
1827  }
1828  theNumberOfMegaTiles = nodeValue.toUInt32();
1829 
1830  //---
1831  // Fetch the Number of MegaTiles in X and Y:
1832  //---
1833 
1834  xml_nodes.clear();
1835  xpath = "/Raster_Data/Raster_Dimensions/Tile_Set/Regular_Tiling/NTILES_COUNT"; //DIMAPv2
1836  xpath = theXmlDocumentRoot + xpath;
1837  xmlDocument->findNodes(xpath, xml_nodes);
1838  if (xml_nodes.size() == 0)
1839  {
1840  setErrorStatus();
1841  if (traceDebug())
1842  {
1843  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: \nCould not find: " << xpath << std::endl;
1844  }
1845  return false;
1846  }
1847 
1848  ossimString value;
1849  ossimString attribute = "ntiles_x";
1850  if (!xml_nodes[0]->getAttributeValue(value, attribute))
1851  {
1852  attribute = "ntiles_R";
1853  xml_nodes[0]->getAttributeValue(value, attribute);
1854  }
1856 
1857  attribute = "ntiles_y";
1858  if (!xml_nodes[0]->getAttributeValue(value, attribute))
1859  {
1860  attribute = "ntiles_C";
1861  xml_nodes[0]->getAttributeValue(value, attribute);
1862  }
1864 
1866  {
1867  setErrorStatus();
1868  if (traceDebug())
1869  {
1870  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: \nIncoherent number of tiles: " << xpath << std::endl;
1871  }
1872  return false;
1873  }
1874 
1875  //---
1876  // Fetch the size of MegaTiles:
1877  //---
1878  xml_nodes.clear();
1879  xpath = "/Raster_Data/Raster_Dimensions/Tile_Set/Regular_Tiling/NTILES_SIZE";
1880  xpath = theXmlDocumentRoot + xpath;
1881  xmlDocument->findNodes(xpath, xml_nodes);
1882  if (xml_nodes.size() == 0)
1883  {
1884  setErrorStatus();
1885  if (traceDebug())
1886  {
1887  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1888  }
1889  return false;
1890  }
1891 
1892 
1893  attribute = "nrows";
1894  xml_nodes[0]->getAttributeValue(value, attribute);
1895  theTileSize.line = value.toUInt32();
1896 
1897  attribute = "ncols";
1898  xml_nodes[0]->getAttributeValue(value, attribute);
1899  theTileSize.samp = value.toUInt32();
1900  }
1901 
1902  //--- TODO_MSD is it useful in the case of RPC model ???
1903  // We will make the RefImagePoint the zero base center of the image. This
1904  // is used by the ossimSensorModel::worldToLineSample iterative loop as
1905  // the starting point. Since the ossimSensorModel does not know of the
1906  // sub image we make it zero base. (comments from spot)
1907  //---
1910 
1911  //---
1912  // Fetch number of bands
1913  //---
1914  xpath = "/Raster_Data/Raster_Dimensions/NBANDS"; //DIMAPv2
1915  xpath = theXmlDocumentRoot + xpath;
1916  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1917  {
1918  return false;
1919  }
1920  theNumBands = nodeValue.toUInt32();
1921 
1922  if (traceDebug())
1923  {
1924  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nNumber of bands: " << theNumBands << std::endl;
1925  }
1926 
1927  //---
1928  // Fetch Band Display Order
1929  //---
1930  xml_nodes.clear();
1931  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/RED_CHANNEL"; //DIMAPv2
1932  xpath = theXmlDocumentRoot + xpath;
1933  xmlDocument->findNodes(xpath, xml_nodes);
1934  if (xml_nodes.size() == 0)
1935  {
1936  setErrorStatus();
1937  if (traceDebug())
1938  {
1939  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1940  }
1941  return false;
1942  }
1943  theBandOrder.push_back(xml_nodes[0]->getText());
1944 
1945  if (theNumBands > 1)
1946  {
1947  xml_nodes.clear();
1948  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/GREEN_CHANNEL"; //DIMAPv2
1949  xpath = theXmlDocumentRoot + xpath;
1950  xmlDocument->findNodes(xpath, xml_nodes);
1951  if (xml_nodes.size() == 0)
1952  {
1953  setErrorStatus();
1954  if (traceDebug())
1955  {
1956  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1957  }
1958  return false;
1959  }
1960  theBandOrder.push_back(xml_nodes[0]->getText());
1961 
1962  xml_nodes.clear();
1963  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/BLUE_CHANNEL"; //DIMAPv2
1964  xpath = theXmlDocumentRoot + xpath;
1965  xmlDocument->findNodes(xpath, xml_nodes);
1966  if (xml_nodes.size() == 0)
1967  {
1968  setErrorStatus();
1969  if (traceDebug())
1970  {
1971  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1972  }
1973  return false;
1974  }
1975  theBandOrder.push_back(xml_nodes[0]->getText());
1976 
1977  if (theNumBands > 3)
1978  {
1979  xml_nodes.clear();
1980  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/ALPHA_CHANNEL"; //DIMAPv2
1981  xpath = theXmlDocumentRoot + xpath;
1982  xmlDocument->findNodes(xpath, xml_nodes);
1983  if (xml_nodes.size() == 0)
1984  {
1985  setErrorStatus();
1986  if (traceDebug())
1987  {
1988  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1989  }
1990  return false;
1991  }
1992 
1993  theBandOrder.push_back(xml_nodes[0]->getText());
1994  }
1995  }
1996 
1997  return true;
1998  }
1999 
2001  {
2002  ossimString xpath;
2003  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2004 
2005  xml_nodes.clear();
2006  xpath = "/Geometric_Data/Use_Area/Located_Geometric_Values"; //DIMAPv2
2007  xpath = theXmlDocumentRoot + xpath;
2008  xmlDocument->findNodes(xpath, xml_nodes);
2009  if (xml_nodes.size() != 9 )
2010  {
2011  setErrorStatus();
2012  if(traceDebug())
2013  {
2014  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2015  }
2016  return false;
2017  }
2018 
2019  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node = xml_nodes.begin();
2020  while (node != xml_nodes.end())
2021  {
2022  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2023 
2024  //---
2025  // Fetch the Sun Azimuth:
2026  //---
2027  xpath = "Solar_Incidences/SUN_AZIMUTH";
2028  (*node)->findChildNodes(xpath, sub_nodes);
2029  if (sub_nodes.size() == 0)
2030  {
2031  setErrorStatus();
2032  if(traceDebug())
2033  {
2034  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2035  }
2036  return false;
2037  }
2038  theSunAzimuth.push_back(sub_nodes[0]->getText().toDouble());
2039 
2040  //---
2041  // Fetch the Sun Elevation:
2042  //---
2043  sub_nodes.clear();
2044  xpath = "Solar_Incidences/SUN_ELEVATION";
2045  (*node)->findChildNodes(xpath, sub_nodes);
2046  if (sub_nodes.size() == 0)
2047  {
2048  setErrorStatus();
2049  if(traceDebug())
2050  {
2051  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2052  }
2053  return false;
2054  }
2055  theSunElevation.push_back(sub_nodes[0]->getText().toDouble());
2056 
2057  //---
2058  // Fetch the Incidence Angle:
2059  //---
2060  sub_nodes.clear();
2061  xpath = "Acquisition_Angles/INCIDENCE_ANGLE"; //DIMAPv2
2062  (*node)->findChildNodes(xpath, sub_nodes);
2063  if (sub_nodes.size() == 0)
2064  {
2065  setErrorStatus();
2066  if(traceDebug())
2067  {
2068  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2069  }
2070  return false;
2071  }
2072  theIncidenceAngle.push_back(sub_nodes[0]->getText().toDouble());
2073 
2074  //---
2075  // Fetch the Viewing Angle:
2076  //---
2077  sub_nodes.clear();
2078  xpath = "Acquisition_Angles/VIEWING_ANGLE"; //DIMAPv2
2079  (*node)->findChildNodes(xpath, sub_nodes);
2080  if (sub_nodes.size() == 0)
2081  {
2082  setErrorStatus();
2083  if(traceDebug())
2084  {
2085  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2086  }
2087  return false;
2088  }
2089  theViewingAngle.push_back(sub_nodes[0]->getText().toDouble());
2090 
2091  //---
2092  // Fetch the Azimuth Angle:
2093  //---
2094  sub_nodes.clear();
2095  xpath = "Acquisition_Angles/AZIMUTH_ANGLE"; //DIMAPv2
2096  (*node)->findChildNodes(xpath, sub_nodes);
2097  if (sub_nodes.size() == 0)
2098  {
2099  setErrorStatus();
2100  if(traceDebug())
2101  {
2102  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2103  }
2104  return false;
2105  }
2106  theAzimuthAngle.push_back(sub_nodes[0]->getText().toDouble());
2107 
2108  ++node;
2109  }
2110 
2111  return true;
2112  }
2113 
2115  ossimRefPtr<ossimXmlDocument> /* xmlDocument */)
2116  {
2117  return true;
2118  }
2119 
2121  {
2122  // static const char MODULE[] = "ossimSpot6DimapSupportData::parseDatasetSources";
2123  ossimString xpath, nodeValue;
2124  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2125 
2126  //---
2127  // Fetch the mission index (1A ou 1B) ?
2128  // and generate theSensorID
2129  //---
2130  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/MISSION";
2131  xpath = theXmlDocumentRoot + xpath;
2132  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
2133  {
2134  return false;
2135  }
2136 
2137  if (nodeValue != "SPOT")
2138  {
2139  setErrorStatus();
2140  if (traceDebug())
2141  {
2142  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nNot a SPOT mission!"<< std::endl;
2143  }
2144  return false;
2145  }
2146 
2147  //---
2148  // Fetch the mission index (1A ou 1B) ?
2149  // and generate theSensorID
2150  //---
2151  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/MISSION_INDEX"; //DIMAPv2
2152  xpath = theXmlDocumentRoot + xpath;
2153  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
2154  {
2155  return false;
2156  }
2157 
2158  if (nodeValue == "6")
2159  theSensorID = "SPOT 6";
2160  else
2161  {
2162  setErrorStatus();
2163  if (traceDebug())
2164  {
2165  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nNot a valid sensorID!"<< std::endl;
2166  }
2167  return false;
2168  }
2169 
2170  //---
2171  // Fetch the Instrument:
2172  //---
2173  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/INSTRUMENT";
2174  xpath = theXmlDocumentRoot + xpath;
2175  if (!readOneXmlNode(xmlDocument, xpath, theInstrument))
2176  {
2177  return false;
2178  }
2179 
2180  //---
2181  // Fetch the Instrument Index:
2182  //---
2183  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/INSTRUMENT_INDEX"; //DIMAPv2
2184  xpath = theXmlDocumentRoot + xpath;
2185  if (!readOneXmlNode(xmlDocument, xpath, theInstrumentIndex))
2186  {
2187  return false;
2188  }
2189 
2190  //---
2191  // Fetch the Imaging Date:
2192  //---
2193  ossimString firstLineImagingDate;
2194  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/IMAGING_DATE"; //DIMAPv2
2195  xpath = theXmlDocumentRoot + xpath;
2196  if (!readOneXmlNode(xmlDocument, xpath, firstLineImagingDate))
2197  {
2198  return false;
2199  }
2200 
2201  //---
2202  // Fetch the Imaging Time:
2203  //---
2204  ossimString firstLineImagingTime;
2205  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/IMAGING_TIME"; //DIMAPv2
2206  xpath = theXmlDocumentRoot + xpath;
2207  if (!readOneXmlNode(xmlDocument, xpath, firstLineImagingTime))
2208  {
2209  return false;
2210  }
2211 
2212  theAcquisitionDate = firstLineImagingDate + "T" + firstLineImagingTime;
2213 
2214  return true;
2215  }
2216 
2217 }
virtual const ossimDatum * create(const ossimString &code) const
create method
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
void clear()
Erases the entire container.
Definition: ossimString.h:432
ossim_uint32 x
virtual bool setValue(const ossimString &value)
void makeNan()
Definition: ossimIpt.h:56
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
std::basic_stringstream< char > stringstream
Class for char mixed input and output memory streams.
Definition: ossimIosFwd.h:38
static const char * IMAGE_DATE_KW
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
Represents serializable keyword/value map.
ossim_uint32 y
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
const char * find(const char *key) const
ossim_int64 fileSize() const
bool parseProductInformation(ossimRefPtr< ossimXmlDocument > xmlDocument)
Product Information:
double samp
Definition: ossimDpt.h:164
double y
Definition: ossimDpt.h:165
bool contains(char aChar) const
Definition: ossimString.h:58
void getRefImagePoint(ossimDpt &rp) const
zero base center point
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void makeNan()
Definition: ossimGpt.h:130
static ossimString toString(bool aValue)
Numeric to string methods.
void getIncidenceAngle(std::vector< ossim_float64 > &ia) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
ossim_uint32 toUInt32() const
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
void getRefGroundPoint(ossimGpt &gp) const
Center of frame, sub image if there is one.
static const char * TYPE_KW
bool parseProcessingInformation(ossimRefPtr< ossimXmlDocument > xmlDocument)
Processing Information:
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
void getSunElevation(std::vector< ossim_float64 > &el) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of the object to a keyword list.
void getViewingAngle(std::vector< ossim_float64 > &va) const
ossim_int32 toInt32() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimGpt createGround(const ossimString &s) const
bool parseDatasetIdentification(ossimRefPtr< ossimXmlDocument > xmlDocument)
Dataset Identification:
double line
Definition: ossimDpt.h:165
bool parseRasterData(ossimRefPtr< ossimXmlDocument > xmlDocument)
ossim_float64 lon
Definition: ossimGpt.h:266
void getImageRect(ossimDrect &rect) const
Zero based image rectangle, sub image if there is one.
unsigned int ossim_uint32
double height() const
Definition: ossimGpt.h:107
bool parseGeometricData(ossimRefPtr< ossimXmlDocument > xmlDocument)
double toDouble() const
static ossimDatumFactory * instance()
bool parseQualityAssessment(ossimRefPtr< ossimXmlDocument > xmlDocument)
QualityAssessment:
static const char * NUMBER_BANDS_KW
bool parseRPCMetadata(ossimRefPtr< ossimXmlDocument > xmlDocument)
static const char * AZIMUTH_ANGLE_KW
bool parseMetadataIdentificationDIMAPv2(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool parseDatasetSources(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool setBooleanValue(bool value, ossimString &msg)
void getSunAzimuth(std::vector< ossim_float64 > &az) const
ossimDpt createDpt(const ossimString &s) const
bool parseDatasetContent(ossimRefPtr< ossimXmlDocument > xmlDocument)
Dataset Content:
bool parseRadiometricData(ossimRefPtr< ossimXmlDocument > xmlDocument)
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
ossim_int32 samp
Definition: ossimIpt.h:141
virtual ossimErrorCode getErrorStatus() const
ossim_int32 y
Definition: ossimIpt.h:142
double x
Definition: ossimDpt.h:164
long long ossim_int64
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
bool empty() const
Definition: ossimString.h:411
bool parseGeoposition(ossimRefPtr< ossimXmlDocument > xmlDocument)
Geoposition:
bool read(std::istream &in)
ossim_int32 line
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
ossim_float64 lat
Definition: ossimGpt.h:265
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
static const char * ELEVATION_ANGLE_KW
bool parseCoordinateReferenceSystem(ossimRefPtr< ossimXmlDocument > xmlDocument)
Coordinate Reference System:
int toInt() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
ossimIpt createIpt(const ossimString &s) const
#define min(a, b)
Definition: auxiliary.h:75
ossimDpt theRefImagePoint
Zero based center of frame.
const std::string & string() const
Definition: ossimString.h:414