21 static ossimTrace traceDebug(
"ossimDoqq:debug");
27 : theErrorStatus(OSSIM_ERROR)
35 : theErrorStatus(OSSIM_ERROR)
43 const std::string& connectionString)
46 if(!str)
return false;
53 if(strcmp((
const char*)header,
"BEGIN_USGS_DOQ_HEADER") == 0)
58 <<
"ossimDoqq::ossimDoqq Loading DOQ version 2 header..." 69 <<
"ossimDoqq::ossimDoqq Loading DOQ version 1 header..." 93 static const char MODULE[] =
"ossimDoqq::ldstr_v2(istream& in)";
107 while((strncmp(line,
"END_USGS_HEADER", 15) != 0)&&
111 in.getline(line, 100);
113 if(strncmp(line,
"SAMPLES_AND_LINES", 17) == 0)
115 sscanf(line,
"%s %s %s", dum1, dum2, dum3);
120 else if(strncmp(line,
"HORIZONTAL_COORDINATE_SYSTEM", 28) == 0)
122 sscanf(line,
"%s %s", dum1, dum2);
126 else if(strncmp(line,
"NW_QUAD_CORNER_XY", 17) == 0)
128 sscanf(line,
"%s %s %s", dum1, dum2, dum3);
134 else if(strncmp(line,
"NE_QUAD_CORNER_XY", 17) == 0)
136 sscanf(line,
"%s %s %s", dum1, dum2, dum3);
141 else if(strncmp(line,
"COORDINATE_ZONE", 15) == 0)
143 sscanf(line,
"%s %s", dum1, dum2);
147 else if(strncmp(line,
"SOURCE_IMAGE_DATE", 17) == 0)
149 sscanf(line,
"%s %s %s %s", dum1, dum2, dum3, dum4);
155 else if((strncmp(line,
"XY_ORIGIN", 9) == 0))
157 sscanf(line,
"%s %s %s", dum1, dum2, dum3);
162 else if((strncmp(line,
"HORIZONTAL_DATUM", 16) == 0) &&
theDatum.
empty())
165 sscanf(line,
"%s %s", dum1, dum2);
174 else if(strncmp(line,
"BYTE_COUNT", 10) == 0)
177 sscanf(line,
"%s %s", dum1, dum2);
183 else if(strncmp(line,
"BAND_CONTENT", 12) == 0)
186 sscanf(line,
"%s %s", dum1, dum2);
195 else if(strncmp(line,
"HORIZONTAL_RESOLUTION", 21) == 0)
198 sscanf(line,
"%s %s", dum1, dum2);
205 else if(strncmp(line,
"QUADRANGLE_NAME", 15) == 0)
207 sscanf(line,
"%s %29c", dum1, dum2);
212 else if(strncmp(line,
"QUADRANT", 8) == 0)
214 sscanf(line,
"%s %s", dum1, dum2);
218 else if(strncmp(line,
"NATION", 6) == 0)
220 sscanf(line,
"%s %s", dum1, dum2);
224 else if(strncmp(line,
"STATE", 5) == 0)
226 sscanf(line,
"%s %s", dum1, dum2);
230 else if(strncmp(line,
"RMSE_XY", 7) == 0)
232 sscanf(line,
"%s %s", dum1, dum2);
236 else if(strncmp(line,
"IMAGE_SOURCE", 12) == 0)
238 sscanf(line,
"%s %29c", dum1, dum2);
243 else if(strncmp(line,
"SOURCE_IMAGE_ID", 15) == 0)
245 sscanf(line,
"%s %29c", dum1, dum2);
257 << MODULE <<
" ERROR:\n" 258 <<
"\tHeader stream is bad." 271 << MODULE <<
" ERROR:\n" 272 <<
"\tInvalid lines or samples or header size." 289 static const char MODULE[] =
"ossimDoqq::ldstr_v1(istream& in)";
307 int data_order = atoi(tmp1);
308 if ( (data_order != 1) && (data_order != 2) )
315 << MODULE <<
" NOTICE:\n" 316 <<
"Invalid data ordering. Not a doq?" << std::endl;
338 << MODULE <<
" ERROR:\n" 339 <<
"\tInvalid lines or samples." 366 if(atoi(rgbType) == 5)
416 const char* prefix =
"doqq.";
417 out << prefix <<
"Quadrangle_Name: " <<
theQuadName << std::endl;
418 out << prefix <<
"Quadrant: " <<
theQuad << std::endl;
421 out << prefix <<
"RMSE_XY: " <<
theRMSE << std::endl;
422 out << prefix <<
"Line: " <<
theLine << std::endl;
423 out << prefix <<
"Sample: " <<
theSample << std::endl;
424 out << prefix <<
"Projection: " <<
theProjection << std::endl;
425 out << prefix <<
"Datum: " <<
theDatum << std::endl;
426 out << prefix <<
"Easting: " <<
theEasting << std::endl;
427 out << prefix <<
"Northing: " <<
theNorthing << std::endl;
428 out << prefix <<
"UN: " <<
theUN << std::endl;
429 out << prefix <<
"UE: " <<
theUE << std::endl;
430 out << prefix <<
"LN: " <<
theLN << std::endl;
431 out << prefix <<
"LE: " <<
theLE << std::endl;
432 out << prefix <<
"GSD: " <<
theGsd << std::endl;
433 out << prefix <<
"Band: " <<
theRgb << std::endl;
434 out << prefix <<
"Utm_Zone: " <<
theUtmZone << std::endl;
virtual bool open(const ossimFilename &file)
open method.
ossimString theSourceImageID
virtual bool open(std::shared_ptr< ossim::istream > &str, const std::string &connectionString)
open method.
ossimString theImageSource
ossimString theAcqYearMonthDay
bool contains(char aChar) const
std::shared_ptr< ossim::istream > m_doqqFileStr
ossim_int32 theRecordSize
void ldstr_v1(std::istream &in)
void ldstr_v2(std::istream &in)
std::string m_connectionString
ossimString theProjection
const char * chars() const
For backward compatibility.
ossim_float64 toFloat64() const
virtual std::ostream & print(std::ostream &out) const
Implementation of ossimInfoBase class pure virtual.
ossim_int32 theHeaderSize
ossim_float64 theNorthing
std::basic_istream< char > istream
Base class for char input streams.
ossimString & gsub(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false)
Substitutes searchKey string with replacementValue and returns a reference to *this.
ossimErrorStatus theErrorStatus
ossim_float64 convertStr(const char *str) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.