Esempio n. 1
0
double rspfSrtmHandler::getHeightAboveMSL(const rspfGpt& gpt)
{
   if(!isOpen()) return rspf::nan();
   if(!m_memoryMap.empty())
   {
      switch(m_scalarType)
      {
         case RSPF_SINT16:
         {
            return getHeightAboveMSLMemoryTemplate((rspf_sint16)0, gpt);
         }
         case RSPF_FLOAT32:
         {
            return getHeightAboveMSLMemoryTemplate((rspf_float32)0, gpt);
         }
         default:
         {
            break;
         }
      }
   }
   else
   {
      switch(m_scalarType)
      {
         case RSPF_SINT16:
         {
            return getHeightAboveMSLFileTemplate((rspf_sint16)0, gpt);
         }
         case RSPF_FLOAT32:
         {
            return getHeightAboveMSLFileTemplate((rspf_float32)0, gpt);
         }
         default:
         {
            break;
         }
      }
   }

   return rspf::nan();
}
Esempio n. 2
0
double ossimGeneralRasterElevHandler::getHeightAboveMSL(const ossimGpt& gpt)
{
   ossim_float64 result = theGeneralRasterInfo.theNullHeightValue;

   if(m_memoryMap.empty())
   {
      switch(theGeneralRasterInfo.theScalarType)
      {
         case OSSIM_SINT8:
         {
            result = getHeightAboveMSLFileTemplate((ossim_sint8)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_UINT8:
         {
            result = getHeightAboveMSLFileTemplate((ossim_uint8)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_SINT16:
         {
            result = getHeightAboveMSLFileTemplate((ossim_sint16)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_UINT16:
         {
            result = getHeightAboveMSLFileTemplate((ossim_uint16)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_SINT32:
         {
            result = getHeightAboveMSLFileTemplate((ossim_sint32)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_UINT32:
         {
            result = getHeightAboveMSLFileTemplate((ossim_uint32)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_FLOAT32:
         {
            result =  getHeightAboveMSLFileTemplate((ossim_float32)0,
                                                    theGeneralRasterInfo,
                                                    gpt);
            break;
         }
         case OSSIM_FLOAT64:
         {
            result = getHeightAboveMSLFileTemplate((ossim_float64)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         default:
         {
            break;
         }
      }
   }
   else
   {
      switch(theGeneralRasterInfo.theScalarType)
      {
         case OSSIM_SINT8:
         {
            result = getHeightAboveMSLMemoryTemplate((ossim_sint8)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_UINT8:
         {
            result = getHeightAboveMSLMemoryTemplate((ossim_uint8)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_SINT16:
         {
            result = getHeightAboveMSLMemoryTemplate((ossim_sint16)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_UINT16:
         {
            result = getHeightAboveMSLMemoryTemplate((ossim_uint16)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_SINT32:
         {
            result = getHeightAboveMSLMemoryTemplate((ossim_sint32)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_UINT32:
         {
            result = getHeightAboveMSLMemoryTemplate((ossim_uint32)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         case OSSIM_FLOAT32:
         {
            result =  getHeightAboveMSLMemoryTemplate((ossim_float32)0,
                                                    theGeneralRasterInfo,
                                                    gpt);
            break;
         }
         case OSSIM_FLOAT64:
         {
            result = getHeightAboveMSLMemoryTemplate((ossim_float64)0,
                                                   theGeneralRasterInfo,
                                                   gpt);
            break;
         }
         default:
         {
            break;
         }
      }
      
   }

   return result;
}