11 static ossimTrace traceDebug(
"ossimDtedElevationDatabase:debug");
25 m_extension(rhs.m_extension),
26 m_upcase(rhs.m_upcase),
46 std::lock_guard<std::mutex> lock(
m_mutex);
89 <<
"ossimDtedElevationDatabase::open entered ...\n" 90 <<
"dir: " << dir <<
"\n";
93 bool result = dir.
isDir();
104 if ( !result && traceDebug() )
107 <<
"ossimDtedElevationDatabase::open: WARNING " 108 <<
"Scan for dted extension failed!\n" 109 <<
"Can be set in ossim preferences. Example:\n" 110 <<
"elevation_manager.elevation_source0.extension: .dt2\n";
121 <<
"ossimDtedElevationDatabase::open: WARNING " 122 <<
"Unable to load goeid grid 1996 for DTED database\n";
131 <<
"ossimDtedElevationDatabase::open result:" << (result?
"true":
"false") <<
"\n";
145 if(tempHandler.
valid())
155 int ilon =
static_cast<int>(floor(gpt.
lond()));
168 s1 << std::setfill(
'0') << std::setw(3)<< ilon;
170 lon += s1.str().
c_str();
172 int ilat =
static_cast<int>(floor(gpt.
latd()));
185 s2<< std::setfill(
'0') << std::setw(2)<< ilat;
187 lat += s2.str().
c_str();
216 std::string pref = (prefix?prefix:
"");
217 std::string key =
"extension";
221 if ( val.
string()[0] !=
'.' )
227 <<
"\nossimDtedElevationDatabase::loadState: WARNING\n" 228 <<
"Key value for \"extension\" does not start with a dot!\n" 229 <<
"Consider changing \"" << val <<
"\" to \"" <<
m_extension <<
"\"\n" 237 else if ( traceDebug() )
240 <<
"\nossimDtedElevationDatabase::loadState: NOTICE\n" 241 <<
"Key lookup for \"extension\" failed!\n" 242 <<
"Can be set in ossim preferences. Example:\n" 243 << pref << key <<
": .dt2\n\n";
252 else if ( traceDebug() )
255 <<
"\nossimDtedElevationDatabase::loadState: NOTICE\n" 256 <<
"Key lookup for \"upcase\" failed!\n" 257 <<
"Can be set in ossim preferences. Example:\n" 258 << pref << key <<
": false\n\n";
288 out <<
"\nossimDtedElevationDatabase @ "<< (
ossim_uint64)
this <<
"\n" 298 bool result = od.
open(dir);
322 bool foundCell = ( ( (fileOnly.
c_str()[0] ==
'e') ||
323 (fileOnly.
c_str()[0] ==
'w') ||
324 (fileOnly.
c_str()[0] ==
'E') ||
325 (fileOnly.
c_str()[0] ==
'W') ) &&
326 (fileOnly.
size() == 4));
345 if(dtedHandler->
open(f,
false))
350 <<
"ossimDtedElevationDatabase::open: Found dted file " << f <<
"\n";
357 dtedHandler->
close();
360 }
while(!result&&d2.
getNext(f)&&(count2 < maxCount2));
364 }
while(!result&&(od.
getNext(f))&&(count < maxCount));
virtual double getHeightAboveMSL(const ossimGpt &)
Height access methods:
virtual bool isSourceEnabled() const
virtual bool open(const ossimString &connectionString)
Open a connection to a database.
const ossimKeywordlist & preferencesKWL() const
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
RTTI_DEF1(ossimDtedElevationDatabase, "ossimDtedElevationDatabase", ossimElevationCellDatabase)
virtual double getHeightAboveMSL(const ossimGpt &)=0
Height access methods:
virtual bool open(const ossimFilename &file, bool memoryMapFlag=false)
opens a cell
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual double getMeanSpacingMeters() const
METHOD: meanSpacingMeters() Implements pure virtual for.
virtual ossimRefPtr< ossimElevCellHandler > createCell(const ossimGpt &gpt)
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
ossimString m_connectionString
ossimString match(const char *regularExpressionPattern) const
Returns from found pattern to end of pattern.
double lond() const
Will convert the radian measure to degrees.
Represents serializable keyword/value map.
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
ossim_uint32 m_memoryMapCellsFlag
bool getFirst(ossimFilename &filename, int flags=OSSIM_DIR_DEFAULT)
ossimDtedElevationDatabase()
double nan()
Method to return ieee floating point double precision NAN.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual double getHeightAboveEllipsoid(const ossimGpt &gpt)
bool inititializeExtension(const ossimFilename &dir)
Scans directory and set m_extension to extension of first dted file found.
double latd() const
Will convert the radian measure to degrees.
bool getNext(ossimFilename &filename) const
virtual bool getAccuracyInfo(ossimElevationAccuracyInfo &info, const ossimGpt &gpt) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual ossimRefPtr< ossimElevCellHandler > getOrCreateCellHandler(const ossimGpt &gpt)
virtual bool pointHasCoverage(const ossimGpt &) const
METHOD: pointIsInsideRect() Method to check if the ground point elevation is defined: ...
bool openDtedDirectory(const ossimFilename &dir)
ossimRefPtr< ossimGeoid > m_geoid
std::string::size_type size() const
ossimGeoid * findGeoidByShortName(const ossimString &shortName, bool caseSensitive=true)
bool toBool() const
String to numeric methods.
unsigned long long ossim_uint64
unsigned int ossim_uint32
static ossimGeoidManager * instance()
Implements singelton pattern:
virtual bool getAccuracyInfo(ossimElevationAccuracyInfo &info, const ossimGpt &gpt) const
ossimRefPtr< ossimElevCellHandler > m_lastHandler
virtual ossimObject * dup() const
the DTED handler is an elevation source that allows for handling of a single cell of data...
ossim_float64 m_meanSpacing
static ossimPreferences * instance()
bool open(const ossimFilename &dir)
The DTED elevation data base is also an elevation source but allows one to point to an file based ele...
virtual ossimErrorCode getErrorStatus() const
virtual double getOffsetFromEllipsoid(const ossimGpt &gpt)
ossimFilename dirCat(const ossimFilename &file) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
ossimFilename file() const
void createRelativePath(ossimFilename &file, const ossimGpt &gpt) const
void createFullPath(ossimFilename &file, const ossimGpt &gpt) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
virtual ~ossimDtedElevationDatabase()
const std::string & string() const