本文整理汇总了C++中ProfileOptions::vsrsString方法的典型用法代码示例。如果您正苦于以下问题:C++ ProfileOptions::vsrsString方法的具体用法?C++ ProfileOptions::vsrsString怎么用?C++ ProfileOptions::vsrsString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProfileOptions
的用法示例。
在下文中一共展示了ProfileOptions::vsrsString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GeoExtent
Profile::Profile(const SpatialReference* srs,
double xmin, double ymin, double xmax, double ymax,
double geo_xmin, double geo_ymin, double geo_xmax, double geo_ymax,
unsigned int numTilesWideAtLod0,
unsigned int numTilesHighAtLod0 ) :
osg::Referenced( true )
{
_extent = GeoExtent( srs, xmin, ymin, xmax, ymax );
_numTilesWideAtLod0 = numTilesWideAtLod0 != 0? numTilesWideAtLod0 : srs->isGeographic()? 2 : 1;
_numTilesHighAtLod0 = numTilesHighAtLod0 != 0? numTilesHighAtLod0 : 1;
_latlong_extent = GeoExtent(
srs->getGeographicSRS(),
geo_xmin, geo_ymin, geo_xmax, geo_ymax );
//if ( !_vsrs.valid() )
// _vsrs = Registry::instance()->getDefaultVSRS();
// make a profile sig (sans srs) and an srs sig for quick comparisons.
ProfileOptions temp = toProfileOptions();
_fullSignature = Stringify() << std::hex << hashString( temp.getConfig().toJSON() );
temp.vsrsString() = "";
_horizSignature = Stringify() << std::hex << hashString( temp.getConfig().toJSON() );
}
示例2: getTileSource
const Profile*
TerrainLayer::getProfile() const
{
// NB: in cache-only mode, there IS NO layer profile.
if ( !_profile.valid() && !isCacheOnly() )
{
if ( !_tileSourceInitAttempted )
{
// Call getTileSource to make sure the TileSource is initialized
getTileSource();
}
if ( _tileSource.valid() && !_profile.valid() && !_tileSourceInitFailed )
{
const_cast<TerrainLayer*>(this)->_profile = _tileSource->getProfile();
// check for a vertical datum override:
if ( _profile.valid() && _runtimeOptions->verticalDatum().isSet() )
{
std::string vdatum = toLower( *_runtimeOptions->verticalDatum() );
if ( _profile->getSRS()->getVertInitString() != vdatum )
{
ProfileOptions po = _profile->toProfileOptions();
po.vsrsString() = vdatum;
const_cast<TerrainLayer*>(this)->_profile = Profile::create(po);
}
}
}
}
return _profile.get();
}
示例3: getSRS
ProfileOptions
Profile::toProfileOptions() const
{
ProfileOptions op;
op.srsString() = getSRS()->getHorizInitString();
op.vsrsString() = getSRS()->getVertInitString();
op.bounds()->xMin() = _extent.xMin();
op.bounds()->yMin() = _extent.yMin();
op.bounds()->xMax() = _extent.xMax();
op.bounds()->yMax() = _extent.yMax();
op.numTilesWideAtLod0() = _numTilesWideAtLod0;
op.numTilesHighAtLod0() = _numTilesHighAtLod0;
return op;
}
示例4:
void
TerrainLayer::applyProfileOverrides()
{
// Check for a vertical datum override.
bool changed = false;
if ( _profile.valid() && _runtimeOptions->verticalDatum().isSet() )
{
std::string vdatum = *_runtimeOptions->verticalDatum();
OE_INFO << "override vdatum = " << vdatum << ", profile vdatum = " << _profile->getSRS()->getVertInitString() << std::endl;
if ( !ciEquals(_profile->getSRS()->getVertInitString(), vdatum) )
{
ProfileOptions po = _profile->toProfileOptions();
po.vsrsString() = vdatum;
_profile = Profile::create(po);
changed = true;
}
}
if (changed && _profile.valid())
{
OE_INFO << LC << "Override profile: " << _profile->toString() << std::endl;
}
}
示例5: if
void
TerrainLayer::initTileSource()
{
_tileSourceInitAttempted = true;
OE_DEBUG << LC << "Initializing tile source ..." << std::endl;
// Instantiate it from driver options if it has not already been created.
// This will also set a manual "override" profile if the user provided one.
if ( !_tileSource.valid() )
{
if ( _runtimeOptions->driver().isSet() )
{
_tileSource = TileSourceFactory::create(*_runtimeOptions->driver());
}
}
// Initialize the profile with the context information:
if ( _tileSource.valid() )
{
// set up the URI options.
if ( !_dbOptions.valid() )
{
_dbOptions = Registry::instance()->cloneOrCreateOptions();
if ( _cache.valid() ) _cache->apply( _dbOptions.get() );
_initOptions.cachePolicy()->apply( _dbOptions.get() );
URIContext( _runtimeOptions->referrer() ).apply( _dbOptions.get() );
}
// report on a manual override profile:
if ( _tileSource->getProfile() )
{
OE_INFO << LC << "set profile to: "
<< _tileSource->getProfile()->toString() << std::endl;
}
// Open the tile source (if it hasn't already been started)
TileSource::Status status = _tileSource->getStatus();
if ( status != TileSource::STATUS_OK )
{
status = _tileSource->open(TileSource::MODE_READ, _dbOptions.get());
}
if ( status == TileSource::STATUS_OK )
{
_tileSize = _tileSource->getPixelsPerTile();
#if 0 //debugging
// dump out data extents:
if ( _tileSource->getDataExtents().size() > 0 )
{
OE_INFO << LC << "Data extents reported:" << std::endl;
for(DataExtentList::const_iterator i = _tileSource->getDataExtents().begin();
i != _tileSource->getDataExtents().end(); ++i)
{
const DataExtent& de = *i;
OE_INFO << " "
<< "X(" << i->xMin() << ", " << i->xMax() << ") "
<< "Y(" << i->yMin() << ", " << i->yMax() << ") "
<< "Z(" << i->minLevel().get() << ", " << i->maxLevel().get() << ")"
<< std::endl;
}
}
#endif
}
else
{
OE_WARN << LC << "Could not initialize driver" << std::endl;
_tileSource = NULL;
_tileSourceInitFailed = true;
_runtimeOptions->enabled() = true;
}
}
// Set the profile from the TileSource if possible:
if ( _tileSource.valid() )
{
if ( !_profile.valid() && !_tileSourceInitFailed )
{
_profile = _tileSource->getProfile();
}
// check for a vertical datum override:
if ( _profile.valid() && _runtimeOptions->verticalDatum().isSet() )
{
std::string vdatum = *_runtimeOptions->verticalDatum();
if ( !ciEquals(_profile->getSRS()->getVertInitString(), vdatum) )
{
OE_INFO << LC << "Overriding vdatum with: " << vdatum << std::endl;
ProfileOptions po = _profile->toProfileOptions();
po.vsrsString() = vdatum;
_profile = Profile::create(po);
}
}
if ( _profile.valid() )
{
OE_INFO << LC << "Profile=" << _profile->toString() << std::endl;
}
//.........这里部分代码省略.........
示例6: if
//.........这里部分代码省略.........
//If the map type is a Geocentric Cube, set the profile to the cube profile.
_profile = osgEarth::Registry::instance()->getCubeProfile();
}
else // CSTYPE_PROJECTED
{
if ( userProfile.valid() )
{
_profile = userProfile.get();
}
}
// At this point, if we don't have a profile we need to search tile sources until we find one.
if ( !_profile.valid() )
{
Threading::ScopedReadLock lock( _mapDataMutex );
for( ImageLayerVector::iterator i = _imageLayers.begin(); i != _imageLayers.end() && !_profile.valid(); i++ )
{
ImageLayer* layer = i->get();
if ( layer->getTileSource() )
{
_profile = layer->getTileSource()->getProfile();
}
}
for( ElevationLayerVector::iterator i = _elevationLayers.begin(); i != _elevationLayers.end() && !_profile.valid(); i++ )
{
ElevationLayer* layer = i->get();
if ( layer->getTileSource() )
{
_profile = layer->getTileSource()->getProfile();
}
}
}
// convert the profile to Plate Carre if necessary.
if (_profile.valid() &&
_profile->getSRS()->isGeographic() &&
getMapOptions().coordSysType() == MapOptions::CSTYPE_PROJECTED )
{
OE_INFO << LC << "Projected display with geographic SRS; activating Plate Carre mode" << std::endl;
_profile = _profile->overrideSRS( _profile->getSRS()->createPlateCarreGeographicSRS() );
}
// finally, fire an event if the profile has been set.
if ( _profile.valid() )
{
OE_INFO << LC << "Map profile is: " << _profile->toString() << std::endl;
for( MapCallbackList::iterator i = _mapCallbacks.begin(); i != _mapCallbacks.end(); i++ )
{
i->get()->onMapInfoEstablished( MapInfo(this) );
}
}
else
{
OE_WARN << LC << "Warning, not yet able to establish a map profile!" << std::endl;
}
}
if ( _profile.valid() )
{
// tell all the loaded layers what the profile is, as a hint
{
Threading::ScopedWriteLock lock( _mapDataMutex );
for( ImageLayerVector::iterator i = _imageLayers.begin(); i != _imageLayers.end(); i++ )
{
ImageLayer* layer = i->get();
if ( layer->getEnabled() == true )
{
layer->setTargetProfileHint( _profile.get() );
}
}
for( ElevationLayerVector::iterator i = _elevationLayers.begin(); i != _elevationLayers.end(); i++ )
{
ElevationLayer* layer = i->get();
if ( layer->getEnabled() )
{
layer->setTargetProfileHint( _profile.get() );
}
}
}
// create a "proxy" profile to use when querying elevation layers with a vertical datum
if ( _profile->getSRS()->getVerticalDatum() != 0L )
{
ProfileOptions po = _profile->toProfileOptions();
po.vsrsString().unset();
_profileNoVDatum = Profile::create(po);
}
else
{
_profileNoVDatum = _profile;
}
}
}