double ossimDtedElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt) { if(!isSourceEnabled()) return ossim::nan(); double result = ossim::nan(); m_mutex.lock(); if(m_lastHandler.valid() && m_lastHandler->pointHasCoverage(gpt)) { result = m_lastHandler->getHeightAboveMSL(gpt); } else { m_lastHandler = getOrCreateCellHandler(gpt); if(m_lastHandler.valid()) result = m_lastHandler->getHeightAboveMSL(gpt); } #if 0 d_mutex.lock(); cout << "THREAD ID: "<<OpenThreads::Thread::CurrentThread()->getThreadId()<<" " <<"ossimDtedElevationDatabase @ "<<(unsigned long)this<<" m_lastHandler @ " <<(unsigned long)m_lastHandler.get()<<endl; //### TODO: for debug, remove d_mutex.unlock(); #endif m_mutex.unlock(); return result; }
double ossimDtedElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt) { if(!isSourceEnabled()) return ossim::nan(); ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt); if(handler.valid()) { return handler->getHeightAboveMSL(gpt); // still need to shift } return ossim::nan(); }
double ossimImageElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt) { double h = ossim::nan(); if(isSourceEnabled()) { ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt); if(handler.valid()) { h = handler->getHeightAboveMSL(gpt); // still need to shift } } return h; }