OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Attributes | Friends | List of all members
ossimApplanixEOFile Class Reference

#include <ossimApplanixEOFile.h>

Inheritance diagram for ossimApplanixEOFile:
ossimReferenced

Public Member Functions

 ossimApplanixEOFile ()
 
bool parseFile (const ossimFilename &file)
 Will parse the entire Exterior orientation file and then index any record ID's found. More...
 
bool parseStream (ossim::istream &in)
 Will parse the stream and set internal queriable parameters. More...
 
bool isEOFile (const ossimFilename &file) const
 Utility method that just checks for an APPlanix exterior orientation header. More...
 
bool isEOFile (ossim::istream &in) const
 Utility method that just checks for an APPlanix exterior orientation header. More...
 
bool parseHeader (const ossimFilename &file, ossimString &header) const
 Parses the header of the exterior orientation file. More...
 
bool parseHeader (ossim::istream &in, ossimString &header) const
 Parses the header of the exterior orientation file. More...
 
ossim_int32 getFieldIdxLike (const ossimString &searchKey) const
 Is a case insensitive parse of the column names for the orientation record. More...
 
ossim_int32 getFieldIdx (const ossimString &searchKey) const
 Is a case insensitive parse of the column names for the orientation record. More...
 
void indexRecordIds ()
 Will index all records based on the "ID #" field for fast searching. More...
 
const ossimRefPtr< ossimApplanixEORecordgetRecordGivenId (const ossimString &id) const
 Given an ID it will search and find an EO record that matches the ID. More...
 
ossim_uint32 getNumberOfRecords () const
 
const ossimRefPtr< ossimApplanixEORecordgetRecord (ossim_uint32 idx) const
 
bool isHeightAboveMSL () const
 
bool isEcefModel () const
 
bool isUtmFrame () const
 
ossim_int32 getUtmZone () const
 
ossimString getUtmHemisphere () const
 
ossimString getSbetField () const
 
double getBoreSightTx () const
 
double getBoreSightTy () const
 
double getBoreSightTz () const
 
double getLeverArmLx () const
 
double getLeverArmLy () const
 
double getLeverArmLz () const
 
double getKardinalKappa () const
 
double getShiftValuesX () const
 
double getShiftValuesY () const
 
double getShiftValuesZ () const
 
ossimString getMappingFrameDatum () const
 
ossimString getMappingFrameProjection () const
 
double getMappingFrameCentralMeridian () const
 
double getMappingFrameOriginLatitude () const
 
double getMappingFrameGridScaleFactor () const
 
double getMappingFrameFalseEasting () const
 
double getMappingFrameFalseNorthing () const
 
ossimString convertToOssimDatumCode (const ossimString &datum) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Attributes

ossimString theHeader
 
ossimString theVersion
 
ossimString theBoreSightTx
 
ossimString theBoreSightTy
 
ossimString theBoreSightTz
 
ossimString theKappaCardinal
 
ossimString theLeverArmLx
 
ossimString theLeverArmLy
 
ossimString theLeverArmLz
 
ossimString theShiftValuesX
 
ossimString theShiftValuesY
 
ossimString theShiftValuesZ
 
ossimString theSbetField
 
ossimString theMappingFrameDatum
 
ossimString theMappingFrameProjection
 
ossimString theCentralMeridian
 
ossimString theOriginLatitude
 
ossimString theGridScaleFactor
 
ossimString theFalseEasting
 
ossimString theFalseNorthing
 
ossimString theUtmZone
 
ossimString theUtmHemisphere
 
ossim_float64 theMinLat
 
ossim_float64 theMinLon
 
ossim_float64 theMaxLat
 
ossim_float64 theMaxLon
 
std::vector< ossimStringtheRecordFormat
 
std::vector< ossimRefPtr< ossimApplanixEORecord > > theApplanixRecordList
 
std::map< ossimString, ossimRefPtr< ossimApplanixEORecord >, ossimStringLtstrtheRecordIdMap
 

Friends

OSSIM_DLL friend std::ostream & operator<< (std::ostream &out, const ossimApplanixEOFile &src)
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 53 of file ossimApplanixEOFile.h.

Constructor & Destructor Documentation

◆ ossimApplanixEOFile()

ossimApplanixEOFile::ossimApplanixEOFile ( )

Definition at line 105 of file ossimApplanixEOFile.cpp.

References ossim::nan(), theMaxLat, theMaxLon, theMinLat, and theMinLon.

106 {
107  theMinLat = ossim::nan();
108  theMinLon = ossim::nan();
109  theMaxLat = ossim::nan();
110  theMaxLon = ossim::nan();
111 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135

Member Function Documentation

◆ convertToOssimDatumCode()

ossimString ossimApplanixEOFile::convertToOssimDatumCode ( const ossimString datum) const

Definition at line 705 of file ossimApplanixEOFile.cpp.

References ossimString::upcase().

706 {
707  ossimString result = "WGE";
708  ossimString temp = datum;
709  temp = temp.upcase();
710 
711  if(temp == "NAD83")
712  {
713  result = "NAR-C";
714  }
715 
716  return result;
717 }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34

◆ getBoreSightTx()

double ossimApplanixEOFile::getBoreSightTx ( ) const

Definition at line 620 of file ossimApplanixEOFile.cpp.

References theBoreSightTx, and ossimString::toDouble().

621 {
622  return theBoreSightTx.toDouble();
623 }
double toDouble() const

◆ getBoreSightTy()

double ossimApplanixEOFile::getBoreSightTy ( ) const

Definition at line 625 of file ossimApplanixEOFile.cpp.

References theBoreSightTy, and ossimString::toDouble().

626 {
627  return theBoreSightTy.toDouble();
628 }
double toDouble() const

◆ getBoreSightTz()

double ossimApplanixEOFile::getBoreSightTz ( ) const

Definition at line 630 of file ossimApplanixEOFile.cpp.

References theBoreSightTz, and ossimString::toDouble().

631 {
632  return theBoreSightTz.toDouble();
633 }
double toDouble() const

◆ getFieldIdx()

ossim_int32 ossimApplanixEOFile::getFieldIdx ( const ossimString searchKey) const

Is a case insensitive parse of the column names for the orientation record.

Note this will check to see if the search key exactly matches a column heading. So if a Heading has something like "ID MORE TEXT" then you can call this with just "ID MORE TEXT" to have a match

Parameters
searchKeythe substring to search for
Returns
The id of the column or -1 if can't find the column

Definition at line 503 of file ossimApplanixEOFile.cpp.

References theRecordFormat, and ossimString::upcase().

Referenced by getRecordGivenId(), isEcefModel(), and isHeightAboveMSL().

504 {
505  ossimString key = searchKey;
506  ossim_uint32 idx = 0;
507 
508  key = key.upcase();
509 
510  for(idx = 0; idx < theRecordFormat.size(); ++idx)
511  {
512  if(ossimString::upcase(theRecordFormat[idx]) == key)
513  {
514  return (int)idx;
515  }
516  }
517 
518  return -1;
519 }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
unsigned int ossim_uint32
std::vector< ossimString > theRecordFormat
ossimString & upcase()
Upcases this string.
Definition: ossimString.cpp:62

◆ getFieldIdxLike()

ossim_int32 ossimApplanixEOFile::getFieldIdxLike ( const ossimString searchKey) const

Is a case insensitive parse of the column names for the orientation record.

Note this will check to see if the search key is contained within any column heading. So if a Heading has something like "ID MORE TEXT" then you can call this with just "ID" and get a match

Parameters
searchKeythe substring to search for
Returns
The id of the column or -1 if can't find the column

Definition at line 486 of file ossimApplanixEOFile.cpp.

References ossimString::contains(), theRecordFormat, and ossimString::upcase().

Referenced by indexRecordIds(), and isUtmFrame().

487 {
488  ossimString key = searchKey;
489  ossim_uint32 idx = 0;
490  key = key.upcase();
491 
492  for(idx = 0; idx < theRecordFormat.size(); ++idx)
493  {
495  {
496  return (int)idx;
497  }
498  }
499 
500  return -1;
501 }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
bool contains(char aChar) const
Definition: ossimString.h:58
unsigned int ossim_uint32
std::vector< ossimString > theRecordFormat
ossimString & upcase()
Upcases this string.
Definition: ossimString.cpp:62

◆ getKardinalKappa()

double ossimApplanixEOFile::getKardinalKappa ( ) const

Definition at line 650 of file ossimApplanixEOFile.cpp.

References theKappaCardinal, and ossimString::toDouble().

651 {
652  return theKappaCardinal.toDouble();
653 }
double toDouble() const

◆ getLeverArmLx()

double ossimApplanixEOFile::getLeverArmLx ( ) const

Definition at line 635 of file ossimApplanixEOFile.cpp.

References theLeverArmLx, and ossimString::toDouble().

636 {
637  return theLeverArmLx.toDouble();
638 }
double toDouble() const

◆ getLeverArmLy()

double ossimApplanixEOFile::getLeverArmLy ( ) const

Definition at line 640 of file ossimApplanixEOFile.cpp.

References theLeverArmLy, and ossimString::toDouble().

641 {
642  return theLeverArmLy.toDouble();
643 }
double toDouble() const

◆ getLeverArmLz()

double ossimApplanixEOFile::getLeverArmLz ( ) const

Definition at line 645 of file ossimApplanixEOFile.cpp.

References theLeverArmLz, and ossimString::toDouble().

646 {
647  return theLeverArmLz.toDouble();
648 }
double toDouble() const

◆ getMappingFrameCentralMeridian()

double ossimApplanixEOFile::getMappingFrameCentralMeridian ( ) const

Definition at line 680 of file ossimApplanixEOFile.cpp.

References theCentralMeridian, and ossimString::toDouble().

681 {
682  return theCentralMeridian.toDouble();
683 }
double toDouble() const

◆ getMappingFrameDatum()

ossimString ossimApplanixEOFile::getMappingFrameDatum ( ) const

Definition at line 670 of file ossimApplanixEOFile.cpp.

References theMappingFrameDatum.

671 {
672  return theMappingFrameDatum;
673 }
ossimString theMappingFrameDatum

◆ getMappingFrameFalseEasting()

double ossimApplanixEOFile::getMappingFrameFalseEasting ( ) const

Definition at line 695 of file ossimApplanixEOFile.cpp.

References theFalseEasting, and ossimString::toDouble().

696 {
697  return theFalseEasting.toDouble();
698 }
double toDouble() const

◆ getMappingFrameFalseNorthing()

double ossimApplanixEOFile::getMappingFrameFalseNorthing ( ) const

Definition at line 700 of file ossimApplanixEOFile.cpp.

References theFalseNorthing, and ossimString::toDouble().

701 {
702  return theFalseNorthing.toDouble();
703 }
double toDouble() const

◆ getMappingFrameGridScaleFactor()

double ossimApplanixEOFile::getMappingFrameGridScaleFactor ( ) const

Definition at line 690 of file ossimApplanixEOFile.cpp.

References theGridScaleFactor, and ossimString::toDouble().

691 {
692  return theGridScaleFactor.toDouble();
693 }
double toDouble() const

◆ getMappingFrameOriginLatitude()

double ossimApplanixEOFile::getMappingFrameOriginLatitude ( ) const

Definition at line 685 of file ossimApplanixEOFile.cpp.

References theOriginLatitude, and ossimString::toDouble().

686 {
687  return theOriginLatitude.toDouble();
688 }
double toDouble() const

◆ getMappingFrameProjection()

ossimString ossimApplanixEOFile::getMappingFrameProjection ( ) const

Definition at line 675 of file ossimApplanixEOFile.cpp.

References theMappingFrameProjection.

676 {
678 }
ossimString theMappingFrameProjection

◆ getNumberOfRecords()

ossim_uint32 ossimApplanixEOFile::getNumberOfRecords ( ) const

Definition at line 555 of file ossimApplanixEOFile.cpp.

References theApplanixRecordList.

556 {
557  return (ossim_uint32)theApplanixRecordList.size();
558 }
unsigned int ossim_uint32
std::vector< ossimRefPtr< ossimApplanixEORecord > > theApplanixRecordList

◆ getRecord()

const ossimRefPtr< ossimApplanixEORecord > ossimApplanixEOFile::getRecord ( ossim_uint32  idx) const

Definition at line 560 of file ossimApplanixEOFile.cpp.

References theApplanixRecordList.

561 {
562  if(idx < theApplanixRecordList.size())
563  {
564  return theApplanixRecordList[idx];
565  }
566 
567  return 0;
568 }
std::vector< ossimRefPtr< ossimApplanixEORecord > > theApplanixRecordList

◆ getRecordGivenId()

const ossimRefPtr< ossimApplanixEORecord > ossimApplanixEOFile::getRecordGivenId ( const ossimString id) const

Given an ID it will search and find an EO record that matches the ID.

If the records are not indexed it will do a linear search on the record array.

Parameters
idThe id of the record to find.
Returns
The exterior orientation for that record.

Definition at line 522 of file ossimApplanixEOFile.cpp.

References getFieldIdx(), theApplanixRecordList, and theRecordIdMap.

523 {
524 
525  if(theRecordIdMap.size())
526  {
527  std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>,
528  ossimStringLtstr >::const_iterator iter = theRecordIdMap.find(id);
529 
530  if(iter!=theRecordIdMap.end())
531  {
532  return iter->second;
533  }
534  }
535  else
536  {
537  ossim_uint32 idx;
538  ossim_int32 idxId = getFieldIdx("ID");
539 
540  if(idxId >= 0)
541  {
542  for(idx = 0; idx < theApplanixRecordList.size(); ++idx)
543  {
544  if((*theApplanixRecordList[idx])[idxId] == id)
545  {
546  return theApplanixRecordList[idx];
547  }
548  }
549  }
550  }
551 
552  return 0;
553 }
unsigned int ossim_uint32
For use with std::map as a compare operator: std::map<ossimString, ossimString, ossimStringLtstr> ...
Definition: ossimString.h:971
std::map< ossimString, ossimRefPtr< ossimApplanixEORecord >, ossimStringLtstr > theRecordIdMap
ossim_int32 getFieldIdx(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.
std::vector< ossimRefPtr< ossimApplanixEORecord > > theApplanixRecordList
int ossim_int32

◆ getSbetField()

ossimString ossimApplanixEOFile::getSbetField ( ) const

Definition at line 615 of file ossimApplanixEOFile.cpp.

References theSbetField.

616 {
617  return theSbetField;
618 }

◆ getShiftValuesX()

double ossimApplanixEOFile::getShiftValuesX ( ) const

Definition at line 655 of file ossimApplanixEOFile.cpp.

References theShiftValuesX, and ossimString::toDouble().

656 {
657  return theShiftValuesX.toDouble();
658 }
double toDouble() const

◆ getShiftValuesY()

double ossimApplanixEOFile::getShiftValuesY ( ) const

Definition at line 660 of file ossimApplanixEOFile.cpp.

References theShiftValuesY, and ossimString::toDouble().

661 {
662  return theShiftValuesY.toDouble();
663 }
double toDouble() const

◆ getShiftValuesZ()

double ossimApplanixEOFile::getShiftValuesZ ( ) const

Definition at line 665 of file ossimApplanixEOFile.cpp.

References theShiftValuesZ, and ossimString::toDouble().

666 {
667  return theShiftValuesZ.toDouble();
668 }
double toDouble() const

◆ getUtmHemisphere()

ossimString ossimApplanixEOFile::getUtmHemisphere ( ) const

Definition at line 610 of file ossimApplanixEOFile.cpp.

References theUtmHemisphere.

611 {
612  return theUtmHemisphere;
613 }

◆ getUtmZone()

ossim_int32 ossimApplanixEOFile::getUtmZone ( ) const

Definition at line 605 of file ossimApplanixEOFile.cpp.

References theUtmZone, and ossimString::toInt32().

Referenced by isUtmFrame().

606 {
607  return theUtmZone.toInt32();
608 }
ossim_int32 toInt32() const

◆ indexRecordIds()

void ossimApplanixEOFile::indexRecordIds ( )

Will index all records based on the "ID #" field for fast searching.

Definition at line 469 of file ossimApplanixEOFile.cpp.

References getFieldIdxLike(), size, theApplanixRecordList, and theRecordIdMap.

470 {
471  ossimString id;
472  ossim_uint32 idx;
473  ossim_int32 idIdx = getFieldIdxLike("ID");
475  theRecordIdMap.clear();
476 
477  if(idIdx < 0) return;
478 
479  for(idx = 0; idx < size; ++idx)
480  {
481  id = (*theApplanixRecordList[idx])[idIdx];
482  theRecordIdMap.insert(std::make_pair(id, theApplanixRecordList[idx]));
483  }
484 }
ossim_int32 getFieldIdxLike(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.
yy_size_t size
unsigned int ossim_uint32
std::map< ossimString, ossimRefPtr< ossimApplanixEORecord >, ossimStringLtstr > theRecordIdMap
std::vector< ossimRefPtr< ossimApplanixEORecord > > theApplanixRecordList
int ossim_int32

◆ isEcefModel()

bool ossimApplanixEOFile::isEcefModel ( ) const

Definition at line 575 of file ossimApplanixEOFile.cpp.

References getFieldIdx().

576 {
577  ossim_int32 xIdx = getFieldIdx("X");
578  ossim_int32 yIdx = getFieldIdx("Y");
579  ossim_int32 zIdx = getFieldIdx("Z");
580  ossim_int32 rollIdx = getFieldIdx("ROLL");
581  ossim_int32 pitchIdx = getFieldIdx("PITCH");
582  ossim_int32 headingIdx = getFieldIdx("HEADING");
583 
584  return ((xIdx >=0)&&
585  (yIdx >=0)&&
586  (zIdx >=0)&&
587  (rollIdx>=0)&&
588  (pitchIdx>=0)&&
589  (headingIdx>=0));
590 }
ossim_int32 getFieldIdx(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.
int ossim_int32

◆ isEOFile() [1/2]

bool ossimApplanixEOFile::isEOFile ( const ossimFilename file) const

Utility method that just checks for an APPlanix exterior orientation header.

Will call the isEOFile(istream) method.

Parameters
filetheExterior orientation file.

Definition at line 128 of file ossimApplanixEOFile.cpp.

References ossim::StreamFactoryRegistry::instance().

129 {
130  bool result = false;
131 
132  std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
133  createIstream( file, std::ios_base::in);
134 
135  if ( in )
136  {
137  result = isEOFile( *in );
138  }
139 
140  return result;
141 }
static StreamFactoryRegistry * instance()
bool isEOFile(const ossimFilename &file) const
Utility method that just checks for an APPlanix exterior orientation header.

◆ isEOFile() [2/2]

bool ossimApplanixEOFile::isEOFile ( ossim::istream in) const

Utility method that just checks for an APPlanix exterior orientation header.

◆ isHeightAboveMSL()

bool ossimApplanixEOFile::isHeightAboveMSL ( ) const

Definition at line 570 of file ossimApplanixEOFile.cpp.

References getFieldIdx().

571 {
572  return (getFieldIdx("ORTHOMETRIC HEIGHT") >= 0);
573 }
ossim_int32 getFieldIdx(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.

◆ isUtmFrame()

bool ossimApplanixEOFile::isUtmFrame ( ) const

Definition at line 593 of file ossimApplanixEOFile.cpp.

References getFieldIdxLike(), and getUtmZone().

594 {
595  return ((getFieldIdxLike("EASTING")>=0)&&
596  (getFieldIdxLike("NORTHING") >=0)&&
597  (getFieldIdxLike("HEIGHT") >= 0)&&
598  (getFieldIdxLike("OMEGA") >=0)&&
599  (getFieldIdxLike("PHI") >=0)&&
600  (getFieldIdxLike("KAPPA") >=0));
601 
602  return (getUtmZone() >= 0.0);
603 }
ossim_int32 getUtmZone() const
ossim_int32 getFieldIdxLike(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.

◆ parseFile()

bool ossimApplanixEOFile::parseFile ( const ossimFilename file)

Will parse the entire Exterior orientation file and then index any record ID's found.

This calls the parseStream method.

Parameters
fileThe exterior orientation file

Definition at line 113 of file ossimApplanixEOFile.cpp.

References ossim::StreamFactoryRegistry::instance(), and parseStream().

114 {
115  bool result = false;
116 
117  std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
118  createIstream(file, std::ios_base::in);
119 
120  if ( in )
121  {
122  result = parseStream( *in );
123  }
124 
125  return result;
126 }
static StreamFactoryRegistry * instance()
bool parseStream(ossim::istream &in)
Will parse the stream and set internal queriable parameters.

◆ parseHeader() [1/2]

bool ossimApplanixEOFile::parseHeader ( const ossimFilename file,
ossimString header 
) const

Parses the header of the exterior orientation file.

Calls the parseHeader(istream, header) method.

Parameters
fileThe filename that is an Applanix Exterior orientation file.
headerThe resulting header that was parsed out.

Definition at line 402 of file ossimApplanixEOFile.cpp.

References ossim::StreamFactoryRegistry::instance().

Referenced by parseStream().

404 {
405  bool result = false;
406 
407  std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
408  createIstream( file, std::ios_base::in);
409 
410  if ( in )
411  {
412  result = parseHeader( *in, header);
413  }
414 
415  return result;
416 }
bool parseHeader(const ossimFilename &file, ossimString &header) const
Parses the header of the exterior orientation file.
static StreamFactoryRegistry * instance()

◆ parseHeader() [2/2]

bool ossimApplanixEOFile::parseHeader ( ossim::istream in,
ossimString header 
) const

Parses the header of the exterior orientation file.

Calls the parseHeader(istream, header) method.

Parameters
inThe input stream That contains an exterior orientation
headerThe resulting header that was parsed out.

◆ parseStream()

bool ossimApplanixEOFile::parseStream ( ossim::istream in)

Will parse the stream and set internal queriable parameters.

Parameters
inTheinput stream containing the Applanix format exterior orientation file

Definition at line 150 of file ossimApplanixEOFile.cpp.

References parseHeader(), theHeader, and theRecordIdMap.

Referenced by parseFile().

151 {
152  theRecordIdMap.clear();
153  ossimString line;
154  int c = '\0';
155  if(!parseHeader(in, theHeader))
156  {
157  return false;
158  }
159 
160  // now parse parameters
161  in>>applanix_skipws;
162  line = "";
163  while(in.good()&&
164  !line.contains("RECORD FORMAT"))
165  {
166  std::getline(in, line.string());
167  line = line.upcase();
168  line = line.substitute("\r","\n", true);
169  if(line.contains("KAPPA CARDINAL"))
170  {
171  theKappaCardinal = line;
172  theKappaCardinal = theKappaCardinal.substitute("KAPPA CARDINAL ROTATION","");
175  }
176  else if(line.contains("LEVER ARM"))
177  {
178  ossimKeywordlist kwl('=');
179  line = line.substitute("LEVER ARM VALUES:",
180  "");
181  line = line.substitute(",",
182  "\n",
183  true);
184  std::istringstream in(line);
185 
186  kwl.parseStream(in);
187 
188  theLeverArmLx = kwl.find("LX");
189  theLeverArmLy = kwl.find("LY");
190  theLeverArmLz = kwl.find("LZ");
191  }
192  else if(line.contains("BORESIGHT VALUES"))
193  {
194  ossimKeywordlist kwl('=');
195  line = line.substitute("BORESIGHT VALUES:",
196  "");
197  line = line.substitute(",",
198  "\n",
199  true);
200 
201  std::istringstream in(line);
202 
203  kwl.parseStream(in);
204 
205 
206  theBoreSightTx = kwl.find("TX");
207  theBoreSightTy = kwl.find("TY");
208  theBoreSightTz = kwl.find("TZ");
209  }
210  else if(line.contains("SHIFT VALUES:"))
211  {
212  ossimKeywordlist kwl('=');
213  line = line.substitute("SHIFT VALUES:","");
214  line = line.substitute(",",
215  "\n",
216  true);
217 
218  std::istringstream in(line);
219  kwl.parseStream(in);
220 
221 
222  theShiftValuesX = kwl.find("X");
223  theShiftValuesY = kwl.find("Y");
224  theShiftValuesZ = kwl.find("Z");
225 
226  }
227  else if(line.contains("GRID:"))
228  {
229  ossimKeywordlist kwl(':');
230  line = line.substitute(";",
231  "\n",
232  true);
233  std::istringstream in(line);
234  kwl.parseStream(in);
235  theUtmZone = kwl.find("ZONE");
236 
237  if(theUtmZone.contains("NORTH"))
238  {
239  theUtmHemisphere = "North";
240  }
241  else
242  {
243  theUtmHemisphere = "South";
244  }
245  theUtmZone = theUtmZone.replaceAllThatMatch("UTM|\\(.*\\)|NORTH|SOUTH","");
247  }
248  else if(line.contains("FRAME DATUM"))
249  {
250  ossimKeywordlist kwl(':');
251  line = line.substitute(";",
252  "\n",
253  true);
254  std::istringstream in(line);
255  kwl.parseStream(in);
256 
257  theMappingFrameDatum = kwl.find("MAPPING FRAME DATUM");
258  theMappingFrameProjection = kwl.find("MAPPING FRAME PROJECTION");
261  }
262  else if(line.contains("POSPROC SBET"))
263  {
264  theSbetField = line.after(":");
266  }
267  else if(line.contains("CENTRAL MERIDIAN"))
268  {
269  theCentralMeridian = line;
270  theCentralMeridian = theCentralMeridian.substitute("CENTRAL MERIDIAN","");
274  }
275  else if(line.contains("LATITUDE OF THE GRID ORIGIN"))
276  {
277  ossimKeywordlist kwl('=');
278  line = line.substitute(";",
279  "\n",
280  true);
281  std::istringstream in(line);
282  kwl.parseStream(in);
283 
284  theOriginLatitude = kwl.find("LATITUDE OF THE GRID ORIGIN");
285  theGridScaleFactor = kwl.find("GRID SCALE FACTOR");
286  }
287  else if(line.contains("FALSE EASTING"))
288  {
289  ossimKeywordlist kwl('=');
290  line = line.substitute(";",
291  "\n",
292  true);
293  std::istringstream in(line);
294  kwl.parseStream(in);
295 
296  theFalseEasting = kwl.find("FALSE EASTING");
297  theFalseNorthing = kwl.find("FALSE NORTHING");
298  }
299  }
300 
301  in>>applanix_skipws;
302 
303  c = in.get();
304 
305  std::vector<ossimString> fieldArray;
306  ossimString field;
307 
308  while(in.good()&&
309  (c!='\n')&&
310  (c!='\r'))
311  {
312  field = "";
313  while((c != ',')&&
314  (c != '\n')&&
315  (c != '\r'))
316  {
317  field += (char)c;
318  c = in.get();
319  }
320  if((c!='\n')&&
321  (c!='\r'))
322  {
323  c = in.get();
324  }
325  field = field.trim();
326  if(field != "")
327  {
328  theRecordFormat.push_back(field);
329  }
330  }
331  in>>applanix_skipws;
332 
333  if(in.peek() == '(')
334  {
335  std::getline(in, line.string());
336  }
337  in>>applanix_skipws;
339  ossim_int32 latIdx = getFieldIdx("LAT");
340  ossim_int32 lonIdx = getFieldIdx("LONG");;
341  bool hasLatLon = (latIdx >=0)&&(lonIdx >= 0);
342 
343 
344  if(hasLatLon)
345  {
346  theMinLat = 90.0;
347  theMaxLat = -90.0;
348  theMinLon = 180.0;
349  theMaxLon = -180.0;
350  }
351  else
352  {
353  theMinLat = ossim::nan();
354  theMaxLat = ossim::nan();
355  theMinLon = ossim::nan();
356  theMaxLon = ossim::nan();
357  }
358 
359  while(in.good()&&theRecordFormat.size())
360  {
361  std::getline(in, line.string());
362  line = line.trim();
363  if(line != "")
364  {
365  std::istringstream inStr(line);
366  ossim_uint32 idx;
367  ossimString value;
368 
369  for(idx = 0; idx < theRecordFormat.size(); ++idx)
370  {
371  inStr >> (*record)[idx];
372  }
373  if(hasLatLon)
374  {
375  double lat = (*record)[latIdx].toDouble();
376  double lon = (*record)[lonIdx].toDouble();
377 
378  if(lat<theMinLat) theMinLat = lat;
379  if(lat>theMaxLat) theMaxLat = lat;
380  if(lon<theMinLon) theMinLon = lon;
381  if(lon>theMaxLon) theMaxLon = lon;
382 
383  }
384  theApplanixRecordList.push_back(new ossimApplanixEORecord(*record));
385  }
386  }
387  indexRecordIds();
388 
389  if(traceDebug())
390  {
391  if(hasLatLon)
392  {
393  ossimNotify(ossimNotifyLevel_DEBUG) << "min lat: " << theMinLat << std::endl
394  << "min lon: " << theMinLon << std::endl
395  << "max lat: " << theMaxLat << std::endl
396  << "max lon: " << theMaxLon << std::endl;
397  }
398  }
399  return true;
400 }
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
Represents serializable keyword/value map.
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
bool contains(char aChar) const
Definition: ossimString.h:58
bool parseHeader(const ossimFilename &file, ossimString &header) const
Parses the header of the exterior orientation file.
std::istream & getline(std::istream &is, ossimString &str, char delim)
Definition: ossimString.h:916
ossimString theMappingFrameDatum
ossimString replaceAllThatMatch(const char *regularExpressionPattern, const char *value="") const
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
double toDouble() const
std::map< ossimString, ossimRefPtr< ossimApplanixEORecord >, ossimStringLtstr > theRecordIdMap
ossim_int32 getFieldIdx(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.
ossimString theMappingFrameProjection
void indexRecordIds()
Will index all records based on the "ID #" field for fast searching.
std::vector< ossimString > theRecordFormat
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
ossimString after(const ossimString &str, std::string::size_type pos=0) const
METHOD: after(str, pos) Returns string immediately after the token str.
std::vector< ossimRefPtr< ossimApplanixEORecord > > theApplanixRecordList
std::string::size_type find(const std::string &s, std::string::size_type pos=0) const
Searches for s as a substring of *this, beginning at character pos of *this.
Definition: ossimString.h:753
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32
const std::string & string() const
Definition: ossimString.h:414

Friends And Related Function Documentation

◆ operator<<

OSSIM_DLL friend std::ostream& operator<< ( std::ostream &  out,
const ossimApplanixEOFile src 
)
friend

Definition at line 53 of file ossimApplanixEOFile.cpp.

54 {
55  ossim_uint32 idx = 0;
56  out << src.theHeader << std::endl << std::endl;
57 
58  if(src.theRecordFormat.size())
59  {
60  std::copy(src.theRecordFormat.begin(),
61  src.theRecordFormat.end()-1,
62  std::ostream_iterator<ossimString>(out, ", "));
63  out << *(src.theRecordFormat.end()-1);
64  out << std::endl;
65  }
66 
67  out << "Kappa Cardinal Rotation = " << src.theKappaCardinal << std::endl;
68  out << "Bore Sight tx = " << src.theBoreSightTx << std::endl
69  << "Bore Sight ty = " << src.theBoreSightTy << std::endl
70  << "Bore Sight tz = " << src.theBoreSightTz << std::endl;
71 
72  out << "Lever arm lx = " << src.theLeverArmLx << std::endl
73  << "Lever arm ly = " << src.theLeverArmLy << std::endl
74  << "Lever arm lz = " << src.theLeverArmLz << std::endl;
75 
76  out << "Shift Value X = " << src.theShiftValuesX << std::endl
77  << "Shift Value Y = " << src.theShiftValuesY << std::endl
78  << "Shift Value Z = " << src.theShiftValuesZ << std::endl;
79 
80  out << "Mapping Frame Datum = " << src.theMappingFrameDatum << std::endl
81  << "Mapping Frame Projection = " << src.theMappingFrameProjection << std::endl
82  << "Central Meridian = " << src.theCentralMeridian << std::endl
83  << "Origin of Latitude = " << src.theOriginLatitude << std::endl
84  << "Grid Scale Factor = " << src.theGridScaleFactor << std::endl
85  << "False easting = " << src.theFalseEasting << std::endl
86  << "False northing = " << src.theFalseNorthing << std::endl;
87 
88  out << "theUtmZone = " << src.theUtmZone << std::endl;
89  out << "theUtmHemisphere = " << src.theUtmHemisphere << std::endl;
90 
91  if(src.theApplanixRecordList.size())
92  {
93  out << std::endl;
94  for(idx = 0; idx < src.theApplanixRecordList.size()-1; ++idx)
95  {
96  out << *(src.theApplanixRecordList[idx]) << std::endl;
97  }
98  out << *(src.theApplanixRecordList[idx]);
99 
100  }
101 
102  return out;
103 }
ossimString theMappingFrameDatum
unsigned int ossim_uint32
ossimString theMappingFrameProjection
std::vector< ossimString > theRecordFormat
std::vector< ossimRefPtr< ossimApplanixEORecord > > theApplanixRecordList

Member Data Documentation

◆ theApplanixRecordList

std::vector< ossimRefPtr<ossimApplanixEORecord> > ossimApplanixEOFile::theApplanixRecordList
protected

◆ theBoreSightTx

ossimString ossimApplanixEOFile::theBoreSightTx
protected

Definition at line 182 of file ossimApplanixEOFile.h.

Referenced by getBoreSightTx(), and operator<<().

◆ theBoreSightTy

ossimString ossimApplanixEOFile::theBoreSightTy
protected

Definition at line 183 of file ossimApplanixEOFile.h.

Referenced by getBoreSightTy(), and operator<<().

◆ theBoreSightTz

ossimString ossimApplanixEOFile::theBoreSightTz
protected

Definition at line 184 of file ossimApplanixEOFile.h.

Referenced by getBoreSightTz(), and operator<<().

◆ theCentralMeridian

ossimString ossimApplanixEOFile::theCentralMeridian
protected

Definition at line 196 of file ossimApplanixEOFile.h.

Referenced by getMappingFrameCentralMeridian(), and operator<<().

◆ theFalseEasting

ossimString ossimApplanixEOFile::theFalseEasting
protected

Definition at line 199 of file ossimApplanixEOFile.h.

Referenced by getMappingFrameFalseEasting(), and operator<<().

◆ theFalseNorthing

ossimString ossimApplanixEOFile::theFalseNorthing
protected

Definition at line 200 of file ossimApplanixEOFile.h.

Referenced by getMappingFrameFalseNorthing(), and operator<<().

◆ theGridScaleFactor

ossimString ossimApplanixEOFile::theGridScaleFactor
protected

Definition at line 198 of file ossimApplanixEOFile.h.

Referenced by getMappingFrameGridScaleFactor(), and operator<<().

◆ theHeader

ossimString ossimApplanixEOFile::theHeader
protected

Definition at line 180 of file ossimApplanixEOFile.h.

Referenced by operator<<(), and parseStream().

◆ theKappaCardinal

ossimString ossimApplanixEOFile::theKappaCardinal
protected

Definition at line 185 of file ossimApplanixEOFile.h.

Referenced by getKardinalKappa(), and operator<<().

◆ theLeverArmLx

ossimString ossimApplanixEOFile::theLeverArmLx
protected

Definition at line 186 of file ossimApplanixEOFile.h.

Referenced by getLeverArmLx(), and operator<<().

◆ theLeverArmLy

ossimString ossimApplanixEOFile::theLeverArmLy
protected

Definition at line 187 of file ossimApplanixEOFile.h.

Referenced by getLeverArmLy(), and operator<<().

◆ theLeverArmLz

ossimString ossimApplanixEOFile::theLeverArmLz
protected

Definition at line 188 of file ossimApplanixEOFile.h.

Referenced by getLeverArmLz(), and operator<<().

◆ theMappingFrameDatum

ossimString ossimApplanixEOFile::theMappingFrameDatum
protected

Definition at line 194 of file ossimApplanixEOFile.h.

Referenced by getMappingFrameDatum(), and operator<<().

◆ theMappingFrameProjection

ossimString ossimApplanixEOFile::theMappingFrameProjection
protected

Definition at line 195 of file ossimApplanixEOFile.h.

Referenced by getMappingFrameProjection(), and operator<<().

◆ theMaxLat

ossim_float64 ossimApplanixEOFile::theMaxLat
protected

Definition at line 206 of file ossimApplanixEOFile.h.

Referenced by ossimApplanixEOFile().

◆ theMaxLon

ossim_float64 ossimApplanixEOFile::theMaxLon
protected

Definition at line 207 of file ossimApplanixEOFile.h.

Referenced by ossimApplanixEOFile().

◆ theMinLat

ossim_float64 ossimApplanixEOFile::theMinLat
protected

Definition at line 204 of file ossimApplanixEOFile.h.

Referenced by ossimApplanixEOFile().

◆ theMinLon

ossim_float64 ossimApplanixEOFile::theMinLon
protected

Definition at line 205 of file ossimApplanixEOFile.h.

Referenced by ossimApplanixEOFile().

◆ theOriginLatitude

ossimString ossimApplanixEOFile::theOriginLatitude
protected

Definition at line 197 of file ossimApplanixEOFile.h.

Referenced by getMappingFrameOriginLatitude(), and operator<<().

◆ theRecordFormat

std::vector<ossimString> ossimApplanixEOFile::theRecordFormat
protected

Definition at line 208 of file ossimApplanixEOFile.h.

Referenced by getFieldIdx(), getFieldIdxLike(), and operator<<().

◆ theRecordIdMap

std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>, ossimStringLtstr> ossimApplanixEOFile::theRecordIdMap
protected

Definition at line 210 of file ossimApplanixEOFile.h.

Referenced by getRecordGivenId(), indexRecordIds(), and parseStream().

◆ theSbetField

ossimString ossimApplanixEOFile::theSbetField
protected

Definition at line 192 of file ossimApplanixEOFile.h.

Referenced by getSbetField().

◆ theShiftValuesX

ossimString ossimApplanixEOFile::theShiftValuesX
protected

Definition at line 189 of file ossimApplanixEOFile.h.

Referenced by getShiftValuesX(), and operator<<().

◆ theShiftValuesY

ossimString ossimApplanixEOFile::theShiftValuesY
protected

Definition at line 190 of file ossimApplanixEOFile.h.

Referenced by getShiftValuesY(), and operator<<().

◆ theShiftValuesZ

ossimString ossimApplanixEOFile::theShiftValuesZ
protected

Definition at line 191 of file ossimApplanixEOFile.h.

Referenced by getShiftValuesZ(), and operator<<().

◆ theUtmHemisphere

ossimString ossimApplanixEOFile::theUtmHemisphere
protected

Definition at line 202 of file ossimApplanixEOFile.h.

Referenced by getUtmHemisphere(), and operator<<().

◆ theUtmZone

ossimString ossimApplanixEOFile::theUtmZone
protected

Definition at line 201 of file ossimApplanixEOFile.h.

Referenced by getUtmZone(), and operator<<().

◆ theVersion

ossimString ossimApplanixEOFile::theVersion
protected

Definition at line 181 of file ossimApplanixEOFile.h.


The documentation for this class was generated from the following files: