osg::Image* QgsGlobeTileSource::createImage( const osgEarth::TileKey& key, osgEarth::ProgressCallback* progress )
{
  Q_UNUSED( progress );

  int tileSize = getPixelsPerTile();
  if ( tileSize <= 0 )
  {
    return osgEarth::ImageUtils::createEmptyImage();
  }

  double xmin, ymin, xmax, ymax;
  key.getExtent().getBounds( xmin, ymin, xmax, ymax );
  QgsRectangle tileExtent( xmin, ymin, xmax, ymax );

  QgsDebugMsg( QString( "Create earth tile image: %1" ).arg( tileExtent.toString( 5 ) ) );
  return new QgsGlobeTileImage( this, tileExtent, getPixelsPerTile(), key.getLOD() );
}
示例#2
0
osgEarth::TileSource::Status QgsGlobeTileSource::initialize( const osgDB::Options * /*dbOptions*/ )
#endif
{
  setProfile( osgEarth::Registry::instance()->getGlobalGeodeticProfile() );
#if OSGEARTH_VERSION_GREATER_OR_EQUAL(2, 8, 0)
  return osgEarth::Status( osgEarth::Status::NoError );
#else
  return STATUS_OK;
#endif
}

osg::Image *QgsGlobeTileSource::createImage( const osgEarth::TileKey &key, osgEarth::ProgressCallback *progress )
{
  Q_UNUSED( progress )

  int tileSize = getPixelsPerTile();
  if ( tileSize <= 0 )
  {
    return osgEarth::ImageUtils::createEmptyImage();
  }

  double xmin, ymin, xmax, ymax;
  key.getExtent().getBounds( xmin, ymin, xmax, ymax );
  QgsRectangle tileExtent( xmin, ymin, xmax, ymax );

  QgsDebugMsg( QString( "Create earth tile image: %1" ).arg( tileExtent.toString( 5 ) ) );
  return new QgsGlobeTileImage( this, tileExtent, getPixelsPerTile(), key.getLOD() );
}

void QgsGlobeTileSource::refresh( const QgsRectangle &dirtyExtent )
{