Esempio n. 1
0
double ossimDtedHandler::getHeightAboveMSL(const ossimGpt& gpt)
{
   if(m_fileStr.is_open())
   {
      return getHeightAboveMSL(gpt, true);
   }
   else if(m_memoryMap.size())
   {
      return getHeightAboveMSL(gpt, false);
   }
   
   return ossim::nan();
}
double ossimTiledElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
{
   double h = getHeightAboveMSL(gpt);
   if(h != ossim::nan())
   {
      h += getOffsetFromEllipsoid(gpt);
   }
   return h;
}
double ossimImageElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
{
   double h = getHeightAboveMSL(gpt);
   if(!ossim::isnan(h))
   {
      h += getOffsetFromEllipsoid(gpt);
   }
   return h;
}
Esempio n. 4
0
void ossimElevManager::getCellsForBounds( const ossim_float64& minLat,
                                          const ossim_float64& minLon,
                                          const ossim_float64& maxLat,
                                          const ossim_float64& maxLon,
                                          std::vector<std::string>& cells, 
                                          ossim_uint32 maxNumberOfCells )
{
   //TODO: Presently incrementing by 0.1 deg. If an elev cell
   // is smaller than this, it may be missed. Need to generalize to support arbitrary cell sizes.

   //TODO: This method relies on the caching of open cells. If the bounds are too large too permit
   // all cells to remain open, this method will incorrectly return a subset of all cells providing
   // coverage.

   // Ping the collection of databases for elevation values at regular intervals inside the bounds.
   // This will autoload the best cells:
   cells.clear();
   const ossim_float64 DELTA_DEG = 0.1; // degree
   ossimGpt gpt;
   for (gpt.lat=minLat; gpt.lat<=maxLat; gpt.lat+=DELTA_DEG)
   {
      for (gpt.lon=minLon; gpt.lon<=maxLon; gpt.lon+=DELTA_DEG)
      {
         getHeightAboveMSL(gpt);
      }
   }

   // Convert filename list to string list (why are they different)?
   ossim_uint32 limitCells = maxNumberOfCells>0?maxNumberOfCells:static_cast<ossim_uint32>(9999999999);
   std::vector<ossimFilename> open_cells;
   getOpenCellList(open_cells);
   std::vector<ossimFilename>::iterator iter = open_cells.begin();
   while ((iter != open_cells.end()) && (cells.size() < limitCells))
   {
      cells.push_back(iter->string());
      ++iter;
   }
}