bool QgsWcsCapabilities::retrieveServerCapabilities( )
{
  clear();

  QStringList versions;

  QString preferredVersion = mUri.param( "version" );

  if ( !preferredVersion.isEmpty() )
  {
    versions << preferredVersion;
  }
  else
  {
    // We prefer 1.0 because 1.1 has many issues, each server implements it in defferent
    // way with various particularities
    // It may happen that server supports 1.1.0 but gives error for 1.1
    versions << "1.0.0" << "1.1.0,1.0.0";
  }

  foreach ( QString v, versions )
  {
    if ( retrieveServerCapabilities( v ) )
    {
      return true;
    }
  }

  return false;
}
Beispiel #2
0
bool QgsWcsCapabilities::retrieveServerCapabilities()
{
  clear();

  QStringList versions;

  QString preferredVersion = mUri.param( QStringLiteral( "version" ) );

  if ( !preferredVersion.isEmpty() )
  {
    versions << preferredVersion;
  }
  else
  {
    // We prefer 1.0 because 1.1 has many issues, each server implements it in
    // a different way with various particularities.
    // It may happen that server supports 1.1.0 but gives error for 1.1
    versions << QStringLiteral( "1.0.0" ) << QStringLiteral( "1.1.0,1.0.0" );
  }

  const auto constVersions = versions;
  for ( const QString &v : constVersions )
  {
    if ( retrieveServerCapabilities( v ) )
    {
      return true;
    }
  }

  return false;
}
Beispiel #3
0
QgsWcsCapabilities::QgsWcsCapabilities( QgsDataSourceUri const &uri )
  : mUri( uri )
{
  QgsDebugMsg( "uri = " + mUri.encodedUri() );

  parseUri();

  retrieveServerCapabilities();
}
// TODO: return if successful
void QgsWcsCapabilities::setUri( QgsDataSourceURI const &theUri )
{
  mUri = theUri;

  clear();

  parseUri();

  retrieveServerCapabilities( );
}
QgsWcsCapabilities::QgsWcsCapabilities( QgsDataSourceURI const &theUri ):
    mUri( theUri ),
    mCoverageCount( 0 ),
    mCacheLoadControl( QNetworkRequest::PreferNetwork )
{
  QgsDebugMsg( "uri = " + mUri.encodedUri() );

  parseUri();

  retrieveServerCapabilities();
}