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

#include <ossimFfL5.h>

Inheritance diagram for ossimFfL5:
ossimFfL7 ossimReferenced ossimErrorStatusInterface ossimPropertyInterface

Public Member Functions

 ossimFfL5 ()
 
 ossimFfL5 (const char *headerFile)
 
ossimRefPtr< ossimFfRevbrevb ()
 
const ossimRefPtr< ossimFfRevbrevb () const
 
- Public Member Functions inherited from ossimFfL7
 ossimFfL7 ()
 
 ossimFfL7 (const char *headerFile)
 
void dump (std::ostream &os) const
 
void writeHeader (std::ostream &os) const
 
int path () const
 
int row () const
 
ossimString pathRow () const
 
void getBias (vector< double > &bias) const
 
double getBias (long bandIdx) const
 
void getGain (vector< double > &gain) const
 
double getGain (long bandIdx) const
 
double getParam (ossim_uint32 i) const
 
virtual unsigned int getBandCount () const
 
long getJulianDay () const
 
ossimString getAcquisitionDate () const
 
void getAcquisitionDate (ossimDate &date) const
 Gets the date as an ossimDate. More...
 
ossimString getSatelliteName () const
 
ossimFilename getBandFilename (ossim_uint32 idx) const
 
int getLinesPerBand () const
 
int getPixelsPerLine () const
 
void getSunElevation (double &elevation) const
 Gets the sun elevation in degrees. More...
 
void getSunAzimuth (double &azimuth) const
 Gets the sun azimuth in degrees. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 Gets a property for matching name. More...
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 Gets a list of property names available. More...
 
- 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
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 

Protected Member Functions

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

Private Member Functions

void readHeaderRevB (const ossimString &header_name)
 
int convertGeoPoint (const char *sptr, ossimGpt &geo_point)
 

Private Attributes

ossimRefPtr< ossimFfRevbtheRevb
 

Friends

std::ostream & operator<< (std::ostream &os, const ossimFfL5 &head)
 

Additional Inherited Members

- Public Attributes inherited from ossimFfL7
char theRequestNumber [21]
 
char theLocationCode [18]
 
int thePathNumber
 
int theRowNumber
 
char theAcquisitionDate [20]
 
char theSatName [11]
 
char theSensorName [11]
 
char theSensorMode [7]
 
double theOffNadirAngle
 
char theProductType [19]
 
char theProductSize [11]
 
char theProcessingType [12]
 
char theResampAlgorithm [3]
 
int thePixelsPerLine
 
int theLinesPerBand
 
int theRecordSize
 
double theGsd
 
int theOutputBitsPerPixel
 
int theAcquiredBitsPerPixel
 
char theBandsPresentString [33]
 
char theBandFileNames [8][30]
 
vector< double > theBias
 
vector< double > theGain
 
char theMapProjectionName [5]
 
char theEllipsoid [19]
 
char theDatum [7]
 
double theProjectionParams [15]
 
int theUsgsMapZone
 
ossimGpt theUL_Corner
 
ossimGpt theUR_Corner
 
ossimGpt theLR_Corner
 
ossimGpt theLL_Corner
 
ossimGpt theCenterGP
 
ossimIpt theCenterImagePoint
 
int theHorizontalOffset
 
double theOrientationAngle
 
double theSunElevation
 
double theSunAzimuth
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 23 of file ossimFfL5.h.

Constructor & Destructor Documentation

◆ ossimFfL5() [1/2]

ossimFfL5::ossimFfL5 ( )

Definition at line 27 of file ossimFfL5.cpp.

28  : ossimFfL7()
29 {
30 }

◆ ossimFfL5() [2/2]

ossimFfL5::ossimFfL5 ( const char *  headerFile)

Definition at line 32 of file ossimFfL5.cpp.

References readHeaderRevB().

33  : ossimFfL7()
34 {
35  // open the header file:
36  readHeaderRevB(headerFile);
37 }
void readHeaderRevB(const ossimString &header_name)
Definition: ossimFfL5.cpp:44

◆ ~ossimFfL5()

ossimFfL5::~ossimFfL5 ( )
protectedvirtual

Definition at line 39 of file ossimFfL5.cpp.

40 {
41 }

Member Function Documentation

◆ convertGeoPoint()

int ossimFfL5::convertGeoPoint ( const char *  sptr,
ossimGpt geo_point 
)
private

Definition at line 141 of file ossimFfL5.cpp.

References ossimGpt::lat, ossimGpt::lon, ossimErrorCodes::OSSIM_ERROR, ossimErrorCodes::OSSIM_OK, and ossimErrorStatusInterface::theErrorStatus.

Referenced by readHeaderRevB().

142 {
143  int londeg;
144  int lonmin;
145  double lonsec;
146  char lonhem;
147  int latdeg;
148  int latmin;
149  double latsec;
150  char lathem;
151 
152  int converted = sscanf(sptr, "%03d%02d%7lf%c %02d%02d%7lf%c",
153  &londeg, &lonmin, &lonsec, &lonhem,
154  &latdeg, &latmin, &latsec, &lathem);
155 
156  if (converted != 8)
157  {
160  }
161 
162  geo_point.lat = (double)latdeg + (double)latmin/60.0 + latsec/3600.0;
163  if (lathem == 'S')
164  geo_point.lat *= -1.0;
165 
166  geo_point.lon= (double)londeg + (double)lonmin/60.0 + lonsec/3600.0;
167  if (lonhem == 'W')
168  geo_point.lon *= -1.0;
169 
171 }
static const ossimErrorCode OSSIM_OK
static const ossimErrorCode OSSIM_ERROR
ossim_float64 lon
Definition: ossimGpt.h:266
ossim_float64 lat
Definition: ossimGpt.h:265

◆ readHeaderRevB()

void ossimFfL5::readHeaderRevB ( const ossimString header_name)
private

Definition at line 44 of file ossimFfL5.cpp.

References convertGeoPoint(), ossimFfRevb::errorStatus(), ossimString::gsub(), max, min, ossimErrorCodes::OSSIM_ERROR, ossimFfRevb::OSSIM_OK, ossimErrorCodes::OSSIM_OK, ossimString::split(), ossimFfL7::theAcquiredBitsPerPixel, ossimFfL7::theAcquisitionDate, ossimFfRevb::theAcquisitionDate, ossimFfL7::theBandFileNames, ossimFfRevb::theBandRadiance, ossimFfL7::theBandsPresentString, ossimFfRevb::theBandsPresentString, ossimFfL7::theBias, ossimFfL7::theCenterGP, ossimFfL7::theCenterImagePoint, ossimFfRevb::theCenterLat, ossimFfRevb::theCenterLine, ossimFfRevb::theCenterLon, ossimFfRevb::theCenterSample, ossimFfL7::theDatum, ossimFfL7::theEllipsoid, ossimFfRevb::theEllipsoid, ossimErrorStatusInterface::theErrorStatus, ossimFfL7::theGain, ossimFfL7::theGsd, ossimFfRevb::theGsd, ossimFfL7::theHorizontalOffset, ossimFfRevb::theInstrumentType, ossimFfL7::theLinesPerBand, ossimFfRevb::theLinesPerImage, ossimFfL7::theLL_Corner, ossimFfRevb::theLlLat, ossimFfRevb::theLlLon, ossimFfL7::theLocationCode, ossimFfL7::theLR_Corner, ossimFfRevb::theLrLat, ossimFfRevb::theLrLon, ossimFfL7::theMapProjectionName, ossimFfRevb::theMapProjName, ossimFfL7::theOffNadirAngle, ossimFfRevb::theOffset, ossimFfL7::theOrientationAngle, ossimFfRevb::theOrientationAngle, ossimFfL7::theOutputBitsPerPixel, ossimFfL7::thePathNumber, ossimFfRevb::thePathRowNumber, ossimFfL7::thePixelsPerLine, ossimFfRevb::thePixelsPerLine, ossimFfL7::theProcessingType, ossimFfRevb::theProcessingType, ossimFfRevb::theProductOrderNumber, ossimFfL7::theProductSize, ossimFfRevb::theProductSize, ossimFfL7::theProductType, ossimFfRevb::theProductType, ossimFfL7::theProjectionParams, ossimFfL7::theRecordSize, ossimFfRevb::theRecordSize, ossimFfL7::theRequestNumber, ossimFfL7::theResampAlgorithm, ossimFfRevb::theResampAlgorithm, theRevb, ossimFfL7::theRowNumber, ossimFfL7::theSatName, ossimFfRevb::theSatNumber, ossimFfL7::theSensorMode, ossimFfL7::theSensorName, ossimFfL7::theSunAzimuth, ossimFfRevb::theSunAzimuth, ossimFfL7::theSunElevation, ossimFfRevb::theSunElevation, ossimFfL7::theUL_Corner, ossimFfRevb::theUlLat, ossimFfRevb::theUlLon, ossimFfL7::theUR_Corner, ossimFfRevb::theUrLat, ossimFfRevb::theUrLon, ossimFfL7::theUsgsMapZone, ossimFfRevb::theUsgsMapZone, ossimFfRevb::theUsgsProjParam, ossimString::toDouble(), ossimIpt::x, and ossimIpt::y.

Referenced by ossimFfL5().

45 {
46  theErrorStatus = ossimErrorCodes::OSSIM_ERROR; // assume error, prove not at end;
47 
48  theRevb = new ossimFfRevb(header_name);
49 
50  if (theRevb->errorStatus() != ossimFfRevb::OSSIM_OK) return;
51 
57  strcpy(theSensorMode, "");
70 
71  //generate band names
72  int i=0;
73  while((theBandsPresentString[i]>='0') && (theBandsPresentString[i]<='9'))
74  {
75  sprintf(theBandFileNames[i],"band%c.dat",theBandsPresentString[i]);
76  ++i;
77  }
78  int nbb=i;
79 
80  std::vector<ossimString> arrayPathRow = ossimString(theLocationCode).split("/");
81  if(arrayPathRow.size() == 2)
82  {
83  thePathNumber = arrayPathRow[0].toInt();
84  theRowNumber = arrayPathRow[1].beforePos(3).toInt();
85  }
86 
87  //extract gains/biases from max/min radiance
88  double min,max;
89  theBias.clear();
90  theGain.clear();
91  for(i=0;i<nbb;++i)
92  {
93  if (sscanf( theRevb->theBandRadiance[i]," %lf/%lf",&max,&min) != 2) return;
94  theBias.push_back(min);
95  theGain.push_back(max/254.0-min/255.0);
96  }
97 
100  strcpy(theDatum, "WGS-84");
101 
102  // added to read in all 15 parameters instead of the first two.
103 
104  for(long parameter=0;parameter < 15; ++parameter)
105  {
106  ossimString temp(theRevb->theUsgsProjParam[parameter]);
107  theProjectionParams[parameter] = temp.gsub('D','E').toDouble();
108  }
109 
111 
112  char temps[256];
113  sprintf(temps,"%s %s",theRevb->theUlLon, theRevb->theUlLat);
115 
116  sprintf(temps,"%s %s",theRevb->theUrLon, theRevb->theUrLat);
118 
119  sprintf(temps,"%s %s",theRevb->theLrLon, theRevb->theLrLat);
121 
122  sprintf(temps,"%s %s",theRevb->theLlLon, theRevb->theLlLat);
124 
125  sprintf(temps,"%s %s",theRevb->theCenterLon, theRevb->theCenterLat);
126  if (convertGeoPoint(temps, theCenterGP) != ossimErrorCodes::OSSIM_OK) return;
127 
130 
135 
136  // The header was successfully extracted:
138  return;
139 }
char theInstrumentType[INSTRUMENT_TYPE_SIZE+1]
Definition: ossimFfRevb.h:213
char theLocationCode[18]
Definition: ossimFfL7.h:135
char thePathRowNumber[PATH_ROW_NUMBER_SIZE+1]
Definition: ossimFfRevb.h:206
vector< double > theBias
Definition: ossimFfL7.h:157
ossimGpt theUL_Corner
Definition: ossimFfL7.h:167
char theDatum[7]
Definition: ossimFfL7.h:163
char theProductType[PRODUCT_TYPE_SIZE+1]
Definition: ossimFfRevb.h:216
int theRowNumber
Definition: ossimFfL7.h:137
char theUrLat[LAT_SIZE+1]
Definition: ossimFfRevb.h:253
char theProcessingType[12]
Definition: ossimFfL7.h:145
double theSunAzimuth
Definition: ossimFfL7.h:178
char theAcquisitionDate[DATE_SIZE+1]
Definition: ossimFfRevb.h:207
char theResampAlgorithm[3]
Definition: ossimFfL7.h:146
char theUrLon[LON_SIZE+1]
Definition: ossimFfRevb.h:252
static const ossimErrorCode OSSIM_OK
char theProductSize[PRODUCT_SIZE_SIZE+1]
Definition: ossimFfRevb.h:217
ossimGpt theUR_Corner
Definition: ossimFfL7.h:168
int theRecordSize
Definition: ossimFfL7.h:149
int theCenterLine
Definition: ossimFfRevb.h:278
int theCenterSample
Definition: ossimFfRevb.h:277
char theProductType[19]
Definition: ossimFfL7.h:143
int theHorizontalOffset
Definition: ossimFfL7.h:175
ossimIpt theCenterImagePoint
Definition: ossimFfL7.h:173
ossimRefPtr< ossimFfRevb > theRevb
Definition: ossimFfL5.h:40
char theBandsPresentString[33]
Definition: ossimFfL7.h:153
int theLinesPerBand
Definition: ossimFfL7.h:148
char theSatName[11]
Definition: ossimFfL7.h:139
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
char theUlLat[LAT_SIZE+1]
Definition: ossimFfRevb.h:248
static const ossimErrorCode OSSIM_ERROR
int theRecordSize
Definition: ossimFfRevb.h:269
char theProductOrderNumber[PRODUCT_ORDER_NUMBER_SIZE+1]
Definition: ossimFfRevb.h:205
char theAcquisitionDate[20]
Definition: ossimFfL7.h:138
char theUlLon[LON_SIZE+1]
Definition: ossimFfRevb.h:247
double theSunElevation
Definition: ossimFfL7.h:177
char theBandRadiance[NUMBER_OF_BANDS][RADIANCE_SIZE+1]
Definition: ossimFfRevb.h:225
char theUsgsProjParam[NUMBER_OF_PROJECTION_PARAMETERS][USGS_PROJ_PARAMS_SIZE+1]
Definition: ossimFfRevb.h:234
double theGsd
Definition: ossimFfRevb.h:243
char theEllipsoid[19]
Definition: ossimFfL7.h:162
char theBandFileNames[8][30]
Definition: ossimFfL7.h:154
char theSensorMode[7]
Definition: ossimFfL7.h:141
char theMapProjectionName[5]
Definition: ossimFfL7.h:161
char theCenterLat[LAT_SIZE+1]
Definition: ossimFfRevb.h:274
char theProcessingType[PROCESSING_TYPE_SIZE+1]
Definition: ossimFfRevb.h:221
ossimGpt theLR_Corner
Definition: ossimFfL7.h:169
char theSatNumber[SAT_NUMBER_SIZE+1]
Definition: ossimFfRevb.h:210
char theSensorName[11]
Definition: ossimFfL7.h:140
char theResampAlgorithm[RESAMPLING_ALGO_SIZE+1]
Definition: ossimFfRevb.h:224
char theLlLat[LAT_SIZE+1]
Definition: ossimFfRevb.h:263
char theBandsPresentString[BANDS_PRESENT_SIZE+1]
Definition: ossimFfRevb.h:267
int theAcquiredBitsPerPixel
Definition: ossimFfL7.h:152
int convertGeoPoint(const char *sptr, ossimGpt &geo_point)
Definition: ossimFfL5.cpp:141
int theSunAzimuth
Definition: ossimFfRevb.h:271
ossimGpt theCenterGP
Definition: ossimFfL7.h:171
char theLrLon[LON_SIZE+1]
Definition: ossimFfRevb.h:257
ossimGpt theLL_Corner
Definition: ossimFfL7.h:170
int thePixelsPerLine
Definition: ossimFfRevb.h:244
char theLrLat[LAT_SIZE+1]
Definition: ossimFfRevb.h:258
int theUsgsMapZone
Definition: ossimFfL7.h:165
int thePathNumber
Definition: ossimFfL7.h:136
char theMapProjName[MAP_PROJ_NAME_SIZE+1]
Definition: ossimFfRevb.h:230
int theUsgsMapZone
Definition: ossimFfRevb.h:232
char theProductSize[11]
Definition: ossimFfL7.h:144
#define max(a, b)
Definition: auxiliary.h:76
ossim_int32 y
Definition: ossimIpt.h:142
int theSunElevation
Definition: ossimFfRevb.h:270
double theOffNadirAngle
Definition: ossimFfL7.h:142
int theLinesPerImage
Definition: ossimFfRevb.h:245
ossim_int32 x
Definition: ossimIpt.h:141
double theGsd
Definition: ossimFfL7.h:150
char theLlLon[LON_SIZE+1]
Definition: ossimFfRevb.h:262
double theProjectionParams[15]
Definition: ossimFfL7.h:164
int thePixelsPerLine
Definition: ossimFfL7.h:147
int errorStatus() const
Definition: ossimFfRevb.h:183
int theOutputBitsPerPixel
Definition: ossimFfL7.h:151
char theEllipsoid[ELLIPSOID_SIZE+1]
Definition: ossimFfRevb.h:240
double theOrientationAngle
Definition: ossimFfRevb.h:229
char theRequestNumber[21]
Definition: ossimFfL7.h:134
char theCenterLon[LON_SIZE+1]
Definition: ossimFfRevb.h:273
vector< double > theGain
Definition: ossimFfL7.h:158
double theOrientationAngle
Definition: ossimFfL7.h:176
#define min(a, b)
Definition: auxiliary.h:75

◆ revb() [1/2]

ossimRefPtr< ossimFfRevb > ossimFfL5::revb ( )

Definition at line 173 of file ossimFfL5.cpp.

References theRevb.

174 {
175  return theRevb;
176 }
ossimRefPtr< ossimFfRevb > theRevb
Definition: ossimFfL5.h:40

◆ revb() [2/2]

const ossimRefPtr< ossimFfRevb > ossimFfL5::revb ( ) const

Definition at line 178 of file ossimFfL5.cpp.

References theRevb.

179 {
180  return theRevb;
181 }
ossimRefPtr< ossimFfRevb > theRevb
Definition: ossimFfL5.h:40

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ossimFfL5 head 
)
friend

Member Data Documentation

◆ theRevb

ossimRefPtr<ossimFfRevb> ossimFfL5::theRevb
private

Definition at line 40 of file ossimFfL5.h.

Referenced by readHeaderRevB(), and revb().


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