本文整理汇总了C++中ossimKeywordlist::addPair方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimKeywordlist::addPair方法的具体用法?C++ ossimKeywordlist::addPair怎么用?C++ ossimKeywordlist::addPair使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimKeywordlist
的用法示例。
在下文中一共展示了ossimKeywordlist::addPair方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void ossimPiecewiseRemapper::ossimBandRemap::saveState(
ossimKeywordlist& kwl,
const std::string& prefix,
ossimPiecewiseRemapper::PiecewiseRemapType remapType,
ossim_uint32 band ) const
{
//---
// Remap set:
// Remap set: "band0.remap0":
// band0.remap0:((0, 127, 0, 127), (128, 255, 128, 382))
// band0.remap1:((0, 382, 0, 255))
//---
ossim_uint32 remapIndex = 0;
std::vector<ossimRemapSet>::const_iterator i = m_remap.begin();
while ( i != m_remap.end() )
{
std::string key = "band";
key += ossimString::toString(band).string();
key += ".";
key += REMAP_KW;
key += ossimString::toString(remapIndex).string();
std::string value;
getRemapSetString( remapType, (*i), value );
kwl.addPair( prefix, key, value );
++i;
++remapIndex;
}
} // End: ossimPiecewiseRemapper::ossimBandRemap::saveState
示例2: saveState
bool ossimPngReader::saveState(ossimKeywordlist& kwl,
const char* prefix) const
{
std::string p = ( prefix ? prefix : "" );
std::string v = ossimString::toString(m_useAlphaChannelFlag).string();
kwl.addPair( p, USE_ALPHA_KW, v, true );
return ossimImageHandler::saveState(kwl, prefix);
}
示例3:
bool ossimH5GridModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
{
// Base save state. This will save the "type" key to "ossimH5GridModel".
bool status = ossimCoarseGridModel::saveState( kwl, prefix );
if ( status )
{
std::string myPrefix = ( prefix ? prefix: "" );
std::string value;
// m_crossesDateline:
value = ossimString::toString(m_crossesDateline).string();
kwl.addPair( myPrefix,CROSSES_DATELINE_KW, value, true );
// Computed wkt footprint:
if ( getWktFootprint( value ) )
{
kwl.addPair( myPrefix, WKT_FOOTPRINT_KW, value, true );
}
// m_boundGndPolygon:
if ( m_boundGndPolygon.getNumberOfVertices() )
{
std::string polyPrefix = myPrefix;
polyPrefix += GROUND_POLYGON_KW;
polyPrefix += ".";
m_boundGndPolygon.saveState( kwl, polyPrefix.c_str() );
}
//---
// theSeedFunction: This is in the base class ossimSensorModel but is not
// in the ossimSensorModel::saveState so do it here.
//---
if ( theSeedFunction.valid() )
{
ossimString seedPrefix = myPrefix;
seedPrefix += "seed_projection.";
status = theSeedFunction->saveState(kwl, seedPrefix.c_str());
}
}
return status;
}
示例4: parseName
bool ossimWkt::parseName( std::istringstream& is,
const std::string& prefix,
const std::string& object,
ossimKeywordlist& kwl )
{
bool result = false;
char c;
std::string name;
// Find the first quote:
while ( is.good() )
{
is.get(c);
if ( is.good() )
{
if ( c == '"' )
{
break;
}
}
}
// Get the name:
while ( is.good() )
{
is.get(c);
if ( is.good() )
{
if ( c != '"' )
{
name.push_back(c);
}
else
{
break; // End quote:
}
}
}
if ( name.size() )
{
// Add to keyword list.
std::string key;
if ( prefix.size() )
{
key += prefix;
}
key += object;
key += ".name";
kwl.addPair( key, name );
result = true;
}
return result;
}
示例5: saveState
bool ossimHdfGridModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
{
bool status = ossimCoarseGridModel::saveState( kwl, prefix );
if ( status )
{
std::string myPrefix = ( prefix ? prefix: "" );
// Add the is hdf4 flag:
std::string key = "is_hdf4";
std::string value = ossimString::toString( m_isHdf4 ).string();
kwl.addPair( myPrefix, key, value, true );
if ( getWktFootprint( value ) )
{
std::string key = "wkt_footprint";
kwl.addPair( myPrefix, key, value, true );
}
}
return status;
}
示例6: saveState
void ossimGpkgTileMatrixSetRecord::saveState( ossimKeywordlist& kwl,
const std::string& prefix ) const
{
std::string myPref = prefix.size() ? prefix : std::string("gpkg_tile_matrix_set.");
std::string value;
std::string key = "table_name";
kwl.addPair(myPref, key, m_table_name, true);
key = "srs_id";
value = ossimString::toString(m_srs_id).string();
kwl.addPair(myPref, key, value, true);
key = "min_x";
value = ossimString::toString(m_min_x, 15).string();
kwl.addPair(myPref, key, value, true);
key = "min_y";
value = ossimString::toString(m_min_y, 15).string();
kwl.addPair(myPref, key, value, true);
key = "max_x";
value = ossimString::toString(m_max_x, 15).string();
kwl.addPair(myPref, key, value, true);
key = "max_y";
value = ossimString::toString(m_max_y, 15).string();
kwl.addPair(myPref, key, value, true);
}
示例7: extractKeysThatMatch
void ossimKeywordlist::extractKeysThatMatch(ossimKeywordlist& kwl,
const ossimString ®ularExpression)const
{
KeywordMap::const_iterator i;
std::vector<ossimString> result;
ossimRegExp regExp;
regExp.compile(regularExpression.c_str());
for(i = m_map.begin(); i != m_map.end(); ++i)
{
if(regExp.find( (*i).first.c_str()))
{
kwl.addPair((*i).first, (*i).second);
}
}
}
示例8: saveState
void ossimGpkgTileMatrixRecord::saveState( ossimKeywordlist& kwl,
const std::string& prefix ) const
{
std::string myPref = prefix.size() ? prefix : std::string("gpkg_tile_matrix.");
std::string value;
std::string key = "table_name";
kwl.addPair(myPref, key, m_table_name, true);
key = "zoom_level";
value = ossimString::toString(m_zoom_level).string();
kwl.addPair(myPref, key, value, true);
key = "matrix_width";
value = ossimString::toString(m_matrix_width).string();
kwl.addPair(myPref, key, value, true);
key = "matrix_height";
value = ossimString::toString(m_matrix_height).string();
kwl.addPair(myPref, key, value, true);
key = "tile_width";
value = ossimString::toString(m_tile_width).string();
kwl.addPair(myPref, key, value, true);
key = "tile_height";
value = ossimString::toString(m_tile_height).string();
kwl.addPair(myPref, key, value, true);
key = "pixel_x_size";
value = ossimString::toString(m_pixel_x_size, 15).string();
kwl.addPair(myPref, key, value, true);
key = "pixel_y_size";
value = ossimString::toString(m_pixel_y_size, 15).string();
kwl.addPair(myPref, key, value, true);
}
示例9: parseParam
bool ossimWkt::parseParam( std::istringstream& is,
const std::string& prefix,
const std::string& object,
ossim_uint32& objectIndex,
ossim_uint32& paramIndex,
ossimKeywordlist& kwl )
{
bool result = false;
char c;
std::string name;
// Get the name:
while ( is.good() )
{
int i = is.peek(); // Don't gobble the trailing comma or bracket.
if ( (i == ',') || (i == ']') || (i == ')') )
{
// End of param.
if ( name.size() )
{
// Add to keyword list.
std::string key;
if ( prefix.size() )
{
key += prefix;
}
key += object;
key += ".param";
key += ossimString::toString(paramIndex).string();
kwl.addPair( key, name );
name = "";
++paramIndex;
result = true;
}
break; // Next param or at end of object.
}
is.get(c);
if ( is.good() )
{
// Look nexted object.
if ( (c == '[') || (c == '(') )
{
std::string myPrefix;
if ( prefix.size() )
{
myPrefix += prefix;
}
myPrefix += object;
myPrefix += ".";
//---
// Special hack for duplicated keyword "PARAMETER"
//---
if ( name == "PARAMETER" )
{
name += ossimString::toString(objectIndex).string();
++objectIndex;
}
result = parseObject( is, myPrefix, name, kwl );
name = "";
}
else
{
name.push_back(c);
}
}
}
return result;
}
示例10: getMapProjectionKwl
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;
//.........这里部分代码省略.........