コード例 #1
0
void ossimBandSelector::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property) return;

   if(property->getName() == "bandSelection")
   {
     ossimString str = property->valueToString();
     std::vector<ossimString> str_vec;
     std::vector<ossim_uint32> int_vec;
     
     str.split( str_vec, " " );
     
     for ( ossim_uint32 i = 0; i < str_vec.size(); ++i )
     {
        if(!str_vec[i].empty())
        {
           int_vec.push_back( str_vec[i].toUInt32() );
        }
     }
     setOutputBandList( int_vec );
   }
   else
   {
      ossimImageSourceFilter::setProperty(property);
   }
}
コード例 #2
0
bool ossimGeneralRasterTileSource::open( const ossimGeneralRasterInfo& info )
{
   if( isOpen() )
   {
      close();
   }
   
   m_rasterInfo = info;

   bool result = initializeHandler();

   if ( result )
   {
      completeOpen();  

      if ( isBandSelector() && m_outputBandList.size() &&
           ( isIdentityBandList( m_outputBandList ) == false ) )
      { 
         // This does range checking and will pass to overview if open.
         setOutputBandList( m_outputBandList );
      }
   }
   
   return result;
}
コード例 #3
0
ファイル: toprsImageReader.cpp プロジェクト: zhouhbsea/toprs
bool toprsImageReader::setOutputBandList( const std::vector<int>& band_list )
{
    bool result = false;
    if ( isBandSelector() )
    {
        std::vector<int> bandList;
        toprsImageSource::getOutputBandList( bandList );
        result = setOutputBandList( bandList );
    }
    return result;
}
コード例 #4
0
bool ossimGeneralRasterTileSource::open()
{
   static const char MODULE[] = "ossimGeneralRasterTileSource::open";

   if (traceDebug()) CLOG << " Entered..." << std::endl;
   
   bool result = false;
   
   if(isOpen())
   {
      close();
   }
   
   //---
   // Find the header file:
   //
   // We need lines, samples, bands, scalar and interleave at a minimum:
   // 
   // A general raster image requires a keyword list to get essential image
   // information or meta data as its sometimes called.  The meta data file
   // can have four types of extensions: ".omd", ".hdr", ".kwl" and xml.
   // Look for them in that order.
   // Note that the ".omd" extension is for "Ossim Meta Data" and was made
   // up to avoid conflicting with other software packages ".hdr" files.
   //---
   if ( m_rasterInfo.open( theImageFile ) )
   {
      theMetaData = m_rasterInfo.getImageMetaData();
      
      result = initializeHandler();
      if ( result )
      {
         completeOpen();

         if ( isBandSelector() && m_outputBandList.size() &&
              ( isIdentityBandList( m_outputBandList ) == false ) )
         {
            // This does range checking and will pass to overview if open.
            setOutputBandList( m_outputBandList );
         }
      }
   }

   if ( traceDebug() )
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
   }
   return result;
}