• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ossimString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ossimString函数的典型用法代码示例。如果您正苦于以下问题:C++ ossimString函数的具体用法?C++ ossimString怎么用?C++ ossimString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ossimString函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ossimNotify

bool ossimQuickbirdMetaData::getMapProjectionKwl( const ossimFilename& imd_file,
                                                  ossimKeywordlist& kwl )
{
   static const char MODULE[] = "ossimQuickbirdMetaData::getMapProjectionKwl";
   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
   }
   
   bool result = false;
   
   if( imd_file.exists() )
   {
      FILE* fptr = fopen (imd_file.c_str(), "r");
      if (fptr)
      {

         char* strptr(NULL);
         
         //---
         // Read the file into a buffer:
         //---
         ossim_int32 fileSize = static_cast<ossim_int32>(imd_file.fileSize());
         char* filebuf = new char[fileSize];
         fread(filebuf, 1, fileSize, fptr);
         strptr = filebuf;
         fclose(fptr);
         ossimString imd_key;
         ossimString tempStr;
         std::string key;
         std::string value;


         // Loop until we find all our keys or bust out with error.
         while ( 1 )
         {
            // Verify map projected.
            imd_key = "BEGIN_GROUP = MAP_PROJECTED_PRODUCT";
            if ( strstr( filebuf, imd_key.c_str() ) == NULL )
            {
               break; // Not a map projected product.
            }

            // Get datum:
            if( getEndOfLine( strptr, ossimString("\n\tdatumName = "), "%13c %s", tempStr) )
            {
               if ( tempStr.contains("WE") )
               {
                  key = "dataum";
                  value   = "WGE";
                  kwl.addPair(key, value);
               }
               else
               {
                  if(traceDebug())
                  {
                     ossimNotify(ossimNotifyLevel_WARN)
                        << "Unhandled datum: " << tempStr << "\n";
                  }
               }
            }

            // Get projection:
            if( getEndOfLine( strptr, ossimString("\n\tmapProjName = "), "%15c %s", tempStr) )
            {
               if ( tempStr.contains("UTM") )
               {
                  key = "type";
                  value   = "ossimUtmProjection";
                  kwl.addPair(key, value);
               }
               else
               {
                  if(traceDebug())
                  {
                     ossimNotify(ossimNotifyLevel_WARN)
                        << "Unhandled projection name: " << tempStr << "\n";
                  }
               }
            }

             // Get projection:
            if( getEndOfLine( strptr, ossimString("\n\tmapProjName = "), "%15c %s", tempStr) )
            {
               if ( tempStr.contains("UTM") )
               {
                  key = "type";
                  value   = "ossimUtmProjection";
                  kwl.addPair(key, value);

                  // Get UTM zone:
                  if( getEndOfLine( strptr, ossimString("\n\tmapZone = "), "%11c %s", tempStr) )
                  {
                     key = "zone";
                     value = tempStr.trim(";").string();
                     kwl.addPair(key, value);
                  }
                  else
                  {
                     break;
//.........这里部分代码省略.........
开发者ID:ossimlabs,项目名称:ossim,代码行数:101,代码来源:ossimQuickbirdMetaData.cpp


示例2: traceDebug

//---
// File: ossimNitfRsmecaTag.cpp
//---

#include <ossim/support_data/ossimNitfRsmecaTag.h>
#include <ossim/support_data/ossimNitfCommon.h>
#include <ossim/base/ossimNotifyContext.h>
#include <ossim/base/ossimTrace.h>
#include <ossim/base/ossimStringProperty.h>

#include <iostream>
#include <iomanip>


static const ossimTrace traceDebug(ossimString("ossimNitfRsmecaTag:debug"));
static const ossimString RNPCF_KW = "RNPCF";
static const ossimString RDPCF_KW = "RDPCF";
//				  "0        1          2"; 
//				  "123456789012345678901";
static const ossimString FILL21 = "                     ";

ossimNitfRsmecaIsg::ossimNitfRsmecaIsg()
   :
   m_numopg(),
   m_errcvg(),
   m_tcdf(),
   m_ncseg(),
   m_corseg(),
   m_tauseg(),
   m_errCovNum(0),
   m_opgNum(0),
开发者ID:LucHermitte,项目名称:ossim,代码行数:31,代码来源:ossimNitfRsmecaTag.cpp


示例3: getBlockaPoints

bool ossimNitfProjectionFactory::getBlockaPoints(
   const ossimNitfImageHeader* hdr,
   std::vector<ossimGpt>& gpts) const
{
   if (!hdr)
   {
      return false;
   }

   ossimRefPtr<ossimNitfRegisteredTag> tag =
      hdr->getTagData(ossimString("BLOCKA"));

   if (!tag)
   {
      if (traceDebug())
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "ossimNitfProjectionFactory::getBlockaPoints DEBUG:"
            << "\nBLOCKA tag not found."
            << std::endl;
      }
      return false;
   }

   if (gpts.size())
   {
      gpts.clear();
   }

   ossimNitfBlockaTag* blockaTag = PTR_CAST(ossimNitfBlockaTag, tag.get());
   if (!blockaTag)
   {
      return false;
   }

   ossimDpt dpt;
   ossimGpt gpt;

   // Get the upper left or first row first column.
   blockaTag->getFrfcLoc(dpt);
   gpt.latd(dpt.y);
   gpt.lond(dpt.x);
   gpts.push_back(gpt);

   // Get the upper right or first row last column.
   blockaTag->getFrlcLoc(dpt);
   gpt.latd(dpt.y);
   gpt.lond(dpt.x);
   gpts.push_back(gpt);

   // Get the lower right or last row last column.
   blockaTag->getLrlcLoc(dpt);
   gpt.latd(dpt.y);
   gpt.lond(dpt.x);
   gpts.push_back(gpt);

   // Get the lower left or last row first column.
   blockaTag->getLrfcLoc(dpt);
   gpt.latd(dpt.y);
   gpt.lond(dpt.x);
   gpts.push_back(gpt);

   if (traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << "ossimNitfProjectionFactory::getBlockaPoints DEBUG:"
         << std::endl;
      for (int i=0; i<4; ++i)
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "gpt[" << i << "] " << gpts[i] << std::endl;
      }
   }
   
   return true;
}
开发者ID:Dukeke,项目名称:ossim,代码行数:76,代码来源:ossimNitfProjectionFactory.cpp


示例4: getPropertyNames

void ossimDtedHdr::getPropertyNames(
   std::vector<ossimString>& propertyNames) const
{
   propertyNames.push_back(ossimString("dted_hdr_record"));
}
开发者ID:ossimlabs,项目名称:ossim,代码行数:5,代码来源:ossimDtedHdr.cpp


示例5: ossimNotify

// Create histogram for entry:
void ossimImageUtil::createHistogram(ossimRefPtr<ossimImageHandler>& ih,
                                     ossim_uint32 entry,
                                     bool useEntryIndex)
{
   static const char M[] = "ossimImageUtil::createHistogram #2";
   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
   }
   
   if ( ih.valid() )
   {
      if (useEntryIndex)
      {
         // Set entry before deriving file name.
         ih->setCurrentEntry(entry);
         ossimNotify(ossimNotifyLevel_NOTICE) << "entry number: "<< entry << std::endl;
      }

      ossimFilename outputFile =
         ih->getFilenameWithThisExtension(ossimString(".his"), useEntryIndex);

      // Only build if needed:
      if ( (outputFile.exists() == false) || rebuildHistogram() )
      {
         ossimNotify(ossimNotifyLevel_NOTICE)
            << "Computing histogram for file: " << ih->getFilename() << std::endl;

         // Check handler to see if it's filtering bands.
         std::vector<ossim_uint32> originalBandList(0);
         if ( ih->isBandSelector() )
         { 
            // Capture for finalize method.
            ih->getOutputBandList( originalBandList );
            
            // Set output list to input.
            ih->setOutputToInputBandList();
         }

         ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
         ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
         
         histoSource->setMaxNumberOfRLevels(1); // Currently hard coded...
         
#if 0 /* TODO tmp drb */
         if( !ossim::isnan(histoMin) )
         {
            histoSource->setMinValueOverride(histoMin);
         }
         
         if( !ossim::isnan(histoMax) )
         {
            histoSource->setMaxValueOverride(histoMax);
         }
         
         if(histoBins > 0)
         {
            histoSource->setNumberOfBinsOverride(histoBins);
         }
#endif
         
         if(traceDebug())
         {
            ossimNotify(ossimNotifyLevel_DEBUG)
               << "Histogram mode: " << getHistogramMode() << "\n";
         }
         
         // Connect histogram source to image handler.
         histoSource->setComputationMode( getHistogramMode() );
         histoSource->connectMyInputTo(0, ih.get() );
         histoSource->enableSource();
         
         // Connect writer to histogram source.
         writer->connectMyInputTo(0, histoSource.get());
         writer->setFilename(outputFile);
         theStdOutProgress.setFlushStreamFlag(true);
         writer->addListener(&theStdOutProgress);
         
         // Compute...
         writer->execute();
         
         writer=0;

         // Reset the band list.
         if ( ih->isBandSelector() && originalBandList.size() )
         {
            ih->setOutputBandList( originalBandList );
         }

      } // Matches: if ( (outputFile.exists() == false) || rebuildHistogram() )
      
   } // Matches: if ( ih.valid() )

   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
   }

} // End: ossimImageUtil::createHistogram #2
开发者ID:Dukeke,项目名称:ossim,代码行数:100,代码来源:ossimImageUtil.cpp


示例6: ossimDrect

bool ossimBuckeyeSensor::loadState(const ossimKeywordlist& kwl,
	const char* prefix)
{
	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::loadState: entering..." << std::endl;

	theImageClipRect = ossimDrect(0,0,8984,6732);
	theRefImgPt      = ossimDpt(4492, 3366);

	ossimSensorModel::loadState(kwl, prefix);
	if(getNumberOfAdjustableParameters() < 1)
	{
		initAdjustableParameters();
	}
	theEcefPlatformPosition    = ossimGpt(0.0,0.0,1000.0);
	theAdjEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
	theRoll    = 0.0;
	thePitch   = 0.0;
	theHeading = 0.0;

	ossimString framemeta_gsti = kwl.find(prefix, "framemeta_gsti");
	ossimString framemeta = kwl.find(prefix,"framemeta");
	ossimString frame_number = kwl.find(prefix, "frame_number");
	ossimString pixel_size = kwl.find(prefix, "pixel_size");
	ossimString principal_point = kwl.find(prefix, "principal_point");
	ossimString focal_length = kwl.find(prefix, "focal_length");
	ossimString smac_radial = kwl.find(prefix, "smac_radial");
	ossimString smac_decent = kwl.find(prefix, "smac_decent");
	ossimString roll;
	ossimString pitch;
	ossimString yaw;
	ossimString platform_position;
	ossimFilename file_to_load;

	ossimString FRAME_STRING	= "Frame#";
	ossimString ROLL_STRING		= "Roll(deg)";
	ossimString PITCH_STRING	= "Pitch(deg)";
	ossimString YAW_STRING		= "Yaw(deg)";
	ossimString LAT_STRING		= "Lat(deg)";
	ossimString LON_STRING		= "Lon(deg)";
	ossimString HAE_STRING		= "HAE(m)";

	// Deal with the fact that there are 3 different types of 'FrameMeta' file
	if (framemeta_gsti.empty() && !framemeta.empty() && !frame_number.empty())
	{
		file_to_load.setFile(framemeta);
		YAW_STRING	= "Azimuth(deg)";
	}
	else if (!framemeta_gsti.empty() && framemeta.empty() && !frame_number.empty())
	{
		file_to_load.setFile(framemeta_gsti);
	}

	if (file_to_load.exists() && !frame_number.empty())
	{
		ossimCsvFile csv(" \t"); // we will use tab or spaces as seaparator
		if(csv.open(file_to_load))
		{
			if(csv.readHeader())
			{
				ossimCsvFile::StringListType heads = csv.fieldHeaderList();
				// Try to see if you can find the first header item, if not, then you either have a file that doesn't work in this case, or it's uppercase
				if (std::find(heads.begin(), heads.end(), FRAME_STRING) == heads.end())
				{
					FRAME_STRING	= FRAME_STRING.upcase();
					ROLL_STRING		= ROLL_STRING.upcase();
					PITCH_STRING	= PITCH_STRING.upcase();
					YAW_STRING		= YAW_STRING.upcase();
					LAT_STRING		= LAT_STRING.upcase();
					LON_STRING		= LON_STRING.upcase();
					HAE_STRING		= HAE_STRING.upcase();
				}

				ossimRefPtr<ossimCsvFile::Record> record;
				bool foundFrameNumber = false;
				while( ((record = csv.nextRecord()).valid()) && !foundFrameNumber)
				{
					if( (*record)[FRAME_STRING] == frame_number)
					{
						foundFrameNumber = true;
						roll = (*record)[ROLL_STRING];
						pitch = (*record)[PITCH_STRING];
						yaw = (*record)[YAW_STRING];
						platform_position = (*record)[LAT_STRING] + " " 
							+ (*record)[LON_STRING]+ " "
							+ (*record)[HAE_STRING] + " WGE";
					}
				}
			}
		}
		csv.close();
	}
	else
	{
		roll = kwl.find(prefix, "roll"); 
		pitch = kwl.find(prefix, "pitch"); 
		yaw = kwl.find(prefix, "heading"); 
		platform_position = kwl.find(prefix, "ecef_platform_position");
	}

	bool result = (!pixel_size.empty()&&
//.........这里部分代码省略.........
开发者ID:Dukeke,项目名称:ossim,代码行数:101,代码来源:ossimBuckeyeSensor.cpp


示例7: ossimString

void ossimPngReader::getPropertyNames(std::vector<ossimString>& propertyNames)const
{
   propertyNames.push_back( ossimString(USE_ALPHA_KW) );
   ossimImageHandler::getPropertyNames(propertyNames);
}
开发者ID:bradh,项目名称:ossim-plugins,代码行数:5,代码来源:ossimPngReader.cpp


示例8: traceDebug

// $Id: ossimNitfCommon.cpp 17978 2010-08-24 16:17:00Z dburken $

#include <cstring> /* for memcpy */
#include <sstream>
#include <iomanip>
#include <sstream>
#include <stdexcept>
#include <iostream>
#include <ossim/support_data/ossimNitfCommon.h>
#include <ossim/base/ossimDms.h>
#include <ossim/base/ossimDpt.h>
#include <ossim/base/ossimIrect.h>
#include <ossim/base/ossimNotify.h>
#include <ossim/base/ossimTrace.h>

static const ossimTrace traceDebug(ossimString("ossimNitfCommon:debug"));

                                   
ossimNitfCommon::ossimNitfCommon(){}

ossimNitfCommon::~ossimNitfCommon(){}

ossimString ossimNitfCommon::convertToScientificString(
   const ossim_float64& aValue,
   ossim_uint32 size)
{
   // Precision cannot hit 0 for this to work...
   if ( ((aValue < 0.0) && (size < 8)) ||
        ((aValue >= 0.0) && (size < 7)) )
   {
      if (traceDebug())
开发者ID:LucHermitte,项目名称:ossim,代码行数:31,代码来源:ossimNitfCommon.cpp


示例9: ossimString

ossimString ossimNetCdfReader::getShortName()const
{
   return ossimString("ossim_netcdf_reader");
}
开发者ID:epifanio,项目名称:planetsasha,代码行数:4,代码来源:ossimNetCdfReader.cpp


示例10: traceDebug

#include <ossim/imaging/ossimNitfTileSource.h>
#include <ossim/projection/ossimBilinearProjection.h>
#include <ossim/projection/ossimEquDistCylProjection.h>
#include <ossim/projection/ossimMgrs.h>
#include <ossim/projection/ossimProjection.h>
#include <ossim/projection/ossimProjectionFactoryRegistry.h>
#include <ossim/projection/ossimUtmProjection.h>
#include <ossim/support_data/ossimNitfBlockaTag.h>
#include <ossim/support_data/ossimNitfFile.h>
#include <ossim/support_data/ossimNitfFileHeader.h>
#include <ossim/support_data/ossimNitfImageHeader.h>
#include <fstream>
#include <cmath>

// Define Trace flags for use within this file:
static ossimTrace traceDebug(ossimString("ossimNitfProjectionFactory:debug"));

ossimNitfProjectionFactory* ossimNitfProjectionFactory::theInstance = 0;

ossimNitfProjectionFactory::ossimNitfProjectionFactory()
{
}

ossimNitfProjectionFactory::~ossimNitfProjectionFactory()
{
}

ossimNitfProjectionFactory* ossimNitfProjectionFactory::instance()
{
   if(!theInstance)
   {
开发者ID:Dukeke,项目名称:ossim,代码行数:31,代码来源:ossimNitfProjectionFactory.cpp


示例11: ossimString

void ossimNitfProjectionFactory::parseUtmString(const ossimString& utmLocation,
                                                ossim_uint32& zone,
                                                std::vector<ossimDpt>& utmPoints)const
{
   ossim_uint32 idx = 0;
   ossimString z;
   ossimString east;
   ossimString north;

   
   z    = ossimString(utmLocation.begin() + idx,
                   utmLocation.begin() + idx + 2);
   idx += 2;
   east = ossimString(utmLocation.begin() + idx,
                      utmLocation.begin() + idx + 6);
   idx += 6;
   north = ossimString(utmLocation.begin() + idx,
                       utmLocation.begin() + idx + 7);
   idx += 7;

   utmPoints.push_back(ossimDpt(east.toDouble(),
                                north.toDouble()));
   
   z    = ossimString(utmLocation.begin() + idx,
                   utmLocation.begin() + idx + 2);
   idx += 2;
   east = ossimString(utmLocation.begin() + idx,
                      utmLocation.begin() + idx + 6);
   idx += 6;
   north = ossimString(utmLocation.begin() + idx,
                       utmLocation.begin() + idx + 7);
   idx += 7;
   utmPoints.push_back(ossimDpt(east.toDouble(),
                                north.toDouble()));

   z    = ossimString(utmLocation.begin() + idx,
                   utmLocation.begin() + idx + 2);
   idx += 2;
   east = ossimString(utmLocation.begin() + idx,
                      utmLocation.begin() + idx + 6);
   idx += 6;
   north = ossimString(utmLocation.begin() + idx,
                       utmLocation.begin() + idx + 7);
   idx += 7;
   utmPoints.push_back(ossimDpt(east.toDouble(),
                                north.toDouble()));

   z    = ossimString(utmLocation.begin() + idx,
                   utmLocation.begin() + idx + 2);
   idx += 2;
   east = ossimString(utmLocation.begin() + idx,
                      utmLocation.begin() + idx + 6);
   idx += 6;
   north = ossimString(utmLocation.begin() + idx,
                       utmLocation.begin() + idx + 7);
   idx += 7;
   utmPoints.push_back(ossimDpt(east.toDouble(),
                                north.toDouble()));

   zone = z.toUInt32();
}
开发者ID:Dukeke,项目名称:ossim,代码行数:61,代码来源:ossimNitfProjectionFactory.cpp


示例12: fopen

//*****************************************************************************
// PROTECTED METHOD: ossimQuickbirdMetaData::parseMetaData()
//
//  Parses the Quickbird IMD file.
//
//*****************************************************************************
bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
{
   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimQuickbirdMetaData::parseMetaData(data_file): entering..." << std::endl;
   
   if( !data_file.exists() )
   {
      if (traceExec()) ossimNotify(ossimNotifyLevel_WARN) << "ossimQuickbirdMetaData::parseMetaData(data_file) WARN:" << "\nmetadate data file <" << data_file << ">. " << "doesn't exist..." << std::endl;
      return false;
   }
  

   FILE* fptr = fopen (data_file, "r");
   if (!fptr)
   {
      if (traceDebug())
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
	    << "ossimQuickbirdRpcModel::parseMetaData(data_file) DEBUG:"
	    << "\nCould not open Meta data file:  " << data_file
	    << "\nreturning with error..." << std::endl;
      }
      return false;
   }

   char* strptr(NULL);

   //---
   // Read the file into a buffer:
   //---
   ossim_int32 fileSize = static_cast<ossim_int32>(data_file.fileSize());
   char* filebuf = new char[fileSize];
   fread(filebuf, 1, fileSize, fptr);
   strptr = filebuf;
   fclose(fptr);
   ossimString temp;

   //---
   // Generation time:
   //---
  
   if(getEndOfLine( strptr, ossimString("\ngenerationTime ="), "%17c %s", temp))
      theGenerationDate = ossimString(temp).before(";");
   else
   {
      if(traceDebug())
      {
         ossimNotify(ossimNotifyLevel_FATAL)
	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
	    << "\n\tAborting construction. Error encountered parsing "
	    << "presumed meta-data file." << std::endl;

         delete [] filebuf;
         return false;
      }
   }

   // Number of rows and columns in full image:
   if(getEndOfLine( strptr, ossimString("\nnumRows ="), "%10c %s", temp))
      theImageSize.line = ossimString(temp).before("\";").toInt();

   if(getEndOfLine( strptr, ossimString("\nnumColumns ="), "%13c %s", temp))
      theImageSize.samp = ossimString(temp).before("\";").toInt();

   //---
   // BandId:
   //---
   if(getEndOfLine( strptr, ossimString("\nbandId ="), "%9c %s", temp))
      theBandId = ossimString(temp).after("\"").before("\";");
   else
   {
      if(traceDebug())
      {
         ossimNotify(ossimNotifyLevel_FATAL)
	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
	    << "\n\tAborting construction. Error encountered parsing "
	    << "presumed meta-data file." << std::endl;

         delete [] filebuf;
         return false;
      }
   }
    
  
   //---
   // BitsPerPixel:
   //---
   if(getEndOfLine( strptr, ossimString("\nbitsPerPixel = "), "%16c %s", temp))
      theBitsPerPixel = ossimString(temp).before(";").toInt();
   else
   {
      if(traceDebug())
      {
         ossimNotify(ossimNotifyLevel_FATAL)
	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
//.........这里部分代码省略.........
开发者ID:ossimlabs,项目名称:ossim,代码行数:101,代码来源:ossimQuickbirdMetaData.cpp


示例13: runTestForFileVariations


//.........这里部分代码省略.........
      
      ossimKeywordlist kwl;
      std::cout << "bad comment? ";
      if(!kwl.addFile(tempFile))
      {
         std::cout << "passed" << std::endl;
      }
      else 
      {
         std::cout << "failed" << std::endl;
      }
   }
   {
      std::ofstream out(tempFile.c_str());
      
      out<< "//adfakdfhkadkjh\n";
      out.close();
      
      ossimKeywordlist kwl;
      std::cout << "good comment? ";
      if(kwl.addFile(tempFile))
      {
         std::cout << "passed" << std::endl;
      }
      else 
      {
         std::cout << "failed" << std::endl;
      }
   }
   {
      std::ofstream out(tempFile.c_str());
      
      out<< "//adfakdfhkadkjh";
      out.close();
      
      ossimKeywordlist kwl;
      std::cout << "good comment no end of line? ";
      if(kwl.addFile(tempFile))
      {
         std::cout << "passed" << std::endl;
      }
      else 
      {
         std::cout << "failed" << std::endl;
      }
   }
   {
      std::ofstream out(tempFile.c_str());
      
      out<< "/test:";
      out.close();
      
      ossimKeywordlist kwl;
      std::cout << "----------- 1 token lookahead problem, single slash start of line with valid key but no value ------------ \n";
      std::cout << "Accepted file? ";
      if(kwl.addFile(tempFile))
      {
         std::cout << "passed" << std::endl;
      }
      else 
      {
         std::cout << "failed" << std::endl;
      }
      std::cout << "Verify key? " << (kwl.find("/test")?"passed\n":"failed\n");
   }
   {
      std::ofstream out(tempFile.c_str());
      
      out<< "test   :";
      out.close();
      std::cout << "----------- trailing spaces for key trimmed ------------ \n";
      
      ossimKeywordlist kwl;
      std::cout << "Accepted file? ";
      if(kwl.addFile(tempFile))
      {
         std::cout << "passed" << std::endl;
      }
      else 
      {
         std::cout << "failed" << std::endl;
      }
      std::cout << "Verify key? " << (kwl.find("test")?"passed\n":"failed\n");
   }
   {

      ossimKeywordlist kwl;
      ossimString value1 ="   --leading and trailing---   ";
      ossimString value2 ="   --trailing---";
      ossimString value3 ="--leading---   ";
      kwl.add("","key1", value1);
      kwl.add("","key2", value2);
      kwl.add("","key3", value3);
      kwl.trimAllValues();
      std::cout << "----------- Testing utility method trimAll values ------------ \n";
      std::cout << "Verify  value1? " << ((value1.trim() == ossimString(kwl.find("key1")))?"passed":"failed") << std::endl;
      std::cout << "Verify  value2? " << ((value2.trim() == ossimString(kwl.find("key2")))?"passed":"failed") << std::endl;
      std::cout << "Verify  value3? " << ((value3.trim() == ossimString(kwl.find("key3")))?"passed":"failed") << std::endl;
   }
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:101,代码来源:ossim-keywordlist-test.cpp


示例14: main

int main(int argc, char* argv[])
{
   static const char MODULE[] = "band_merge:main";

   std::string tempString;
   ossimArgumentParser::ossimParameter stringParam(tempString);
   ossimArgumentParser argumentParser(&argc, argv);
   ossimInit::instance()->addOptions(argumentParser);
   ossimInit::instance()->initialize(argumentParser);
 
   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" merges band separate images to one image");
   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
   argumentParser.getApplicationUsage()->addCommandLineOption("-o or --create-overiew", "Creates and overview for the output image");
   argumentParser.getApplicationUsage()->addCommandLineOption("-w or --tile-width", "Defines the tile width for the handlers that support tiled output");
   
   if (traceDebug()) CLOG << " Entered..." << std::endl;

   if (argumentParser.read("-h") ||
       argumentParser.read("--help")||(argumentParser.argc() < 2))
   {
      argumentParser.getApplicationUsage()->write(std::cout);
      usage(); // for writer output types
      exit(0);
   }

   // Keyword list to initialize image writers with.
   ossimKeywordlist kwl;
   const char* PREFIX = "imagewriter.";

   ossim_uint32 tile_width = 32;
   bool create_overview = false;

   if (argumentParser.read("-o") || argumentParser.read("--crate-overview"))
   {
      create_overview = true;
      std::cout << "\nOutput overview building enabled." << std::endl;
   }

   if (argumentParser.read("-w", stringParam) ||
       argumentParser.read("-tile-width", stringParam))
   {
      tile_width = ossimString(tempString).toInt();
      if ((tile_width % 16) != 0)
      {
         cerr << MODULE << " NOTICE:"
              << "\nTile width must be a multiple of 16!"
              << "\nDefaulting to 128"
              << std::endl;
         tile_width = 0;
      }
      std::cout << "Tile width set to:  " << tile_width << std::endl;
   }
   
   argumentParser.reportRemainingOptionsAsUnrecognized();
   
   // Three required args:  output_type, input file, and output file.
   if (argumentParser.errors())
   {
      argumentParser.writeErrorMessages(std::cout);
      exit(0);
   }
   if (argumentParser.argc() == 1)
   {
      argumentParser.getApplicationUsage()->write(std::cout);
      usage(); // for writer output types
      exit(0);
   }
   
   ossim_uint32 number_of_source_images = argumentParser.argc() - 3;

   if (traceDebug())
   {
      CLOG << "DEBUG:"
           << "\nargc:  " << argumentParser.argc()
           << "\nnumber_of_source_images:  " << number_of_source_images
           << "\ntile_width:  " << tile_width
           << "\ncreate_overview:  " << (create_overview?"true":"false")
           << std::endl;
   }

   ossimString output_type = argv[1];
   output_type.downcase();
   std::cout << "Output type:        " << output_type << std::endl;

   // Create the vector of image handlers.
   ossimConnectableObject::ConnectableObjectList ihs;
   for(ossim_uint32 h = 0; h < number_of_source_images; ++h)
   {
      ossimFilename f = argv[h + 2];
      std::cout << "Input_image[" << h << "]:     " << f << std::endl;
      ihs.push_back(ossimImageHandlerRegistry::instance()->open(f));
   }

   // Get the output file.
   ossimFilename output_file = argv[argumentParser.argc() - 1];
   std::cout << "Output file:        " << output_file << std::endl;   

   //---
   // Set the output writer type and the image type.
//.........这里部分代码省略.........
开发者ID:BJangeofan,项目名称:ossim,代码行数:101,代码来源:ossim-band-merge.cpp


示例15: ossimNotify

bool ImageNoise::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
  static const char MODULE[] = "ImageNoise::loadState";
  bool result = true;
  std::string pfx;
  std::string pfx2;
  if (prefix)
  {
    pfx = prefix;
  }
   ossimString s;
   const char* lookup = 0;

  pfx += PREFIX;
  lookup = kwl.find(pfx.c_str(), TIME_UTC);
  if (lookup)
  {
    s = lookup;
    _timeUTC = s;
  }
  else
  {
    ossimNotify(ossimNotifyLevel_WARN)
         << MODULE << " Keyword not found: " << TIME_UTC << " in "<<pfx.c_str()<<" path.\n";
    result = false;
  }
  pfx2 = pfx + NOISE_ESTIMATE;
  lookup = kwl.find(pfx2.c_str(), VALIDITY_RANGE_MIN);
  if (lookup)
  {
    s = lookup;
    _validityRangeMin = s.toDouble();
  }
  else
  {
    ossimNotify(ossimNotifyLevel_WARN)
         << MODULE << " Keyword not found: " << VALIDITY_RANGE_MIN << " in "<<pfx2.c_str()<<" path.\n";
    result = false;
  }
  lookup = kwl.find(pfx2.c_str(), VALIDITY_RANGE_MAX);
  if (lookup)
  {
    s = lookup;
    _validityRangeMax = s.toDouble();
  }
  else
  {
    ossimNotify(ossimNotifyLevel_WARN)
         << MODULE << " Keyword not found: " << VALIDITY_RANGE_MAX << " in "<<pfx2.c_str()<<" path\n";
    result = false;
  }
  lookup = kwl.find(pfx2.c_str(), REFERENCE_POINT);
  if (lookup)
  {
    s = lookup;
    _referencePoint = s.toDouble();
  }
  else
  {
    ossimNotify(ossimNotifyLevel_WARN)
         << MODULE << " Keyword not found: " << REFERENCE_POINT << " in "<<pfx2.c_str()<<" path\n";
    result = false;
  }
  lookup = kwl.find(pfx2.c_str(), POLYNOMIAL_DEGREE);
  if (lookup)
  {
    s = lookup;
    _polynomialDegree = s.toInt32();
  }
  else
  {
    ossimNotify(ossimNotifyLevel_WARN)
         << MODULE << " Keyword not found: " << POLYNOMIAL_DEGREE << " in "<<pfx2.c_str()<<" path\n";
    result = false;
  }

  for(unsigned int i=0 ; i<_polynomialDegree+1;i++)
  {
      ossimString iStr = ossimString::toString(i);
      ossimString kw = ossimString(COEFFICIENT) + "["+iStr+ "]";
      lookup = kwl.find(pfx2.c_str(), kw.c_str());
      if (lookup)
      {
        s = lookup;
        _polynomialCoefficients.push_back( s.toDouble() );
      }
      else
      {
        ossimNotify(ossimNotifyLevel_WARN)
         << MODULE << " Keyword not found: " << kw.c_str() << " in "<<pfx2.c_str()<<" path\n";
        result = false;
      }
  }


/*
   pfx += "ImageNoise.";

   const char* lookup = 0;
   ossimString s;
//.........这里部分代码省略.........
开发者ID:ICODE-MDA,项目名称:AutomatedSARShipDetection,代码行数:101,代码来源:ImageNoise.cpp


示例16: ossimString

ossimString ossimNitfRsmecaTag::getUrr() const
{
   return ossimString(m_urr);
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:4,代码来源:ossimNitfRsmecaTag.cpp



注:本文中的ossimString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ossl_obj2bio函数代码示例发布时间:2022-05-30
下一篇:
C++ ossimNotify函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap