Esempio n. 1
0
QgsWcsCoverageSummary *QgsWcsCapabilities::coverageSummary( QString const &identifier, QgsWcsCoverageSummary *parent )
{
  QgsDebugMsgLevel( "theIdentifier = " + identifier, 5 );
  if ( !parent )
  {
    parent = &( mCapabilities.contents );
  }

  for ( QVector<QgsWcsCoverageSummary>::iterator c = parent->coverageSummary.begin(); c != parent->coverageSummary.end(); ++c )
  {
    if ( c->identifier == identifier )
    {
      return c;
    }
    else
    {
      // search sub coverages
      QgsWcsCoverageSummary *sc = coverageSummary( identifier, c );
      if ( sc )
      {
        return sc;
      }
    }
  }
  return nullptr;
}
Esempio n. 2
0
QgsWcsCoverageSummary QgsWcsCapabilities::coverage( QString const &identifier )
{
  QgsWcsCoverageSummary *cp = coverageSummary( identifier );
  if ( cp ) return *cp;

  QgsWcsCoverageSummary c;
  initCoverageSummary( c );
  return c;
}
Esempio n. 3
0
bool QgsWcsCapabilities::describeCoverage( QString const &identifier, bool forceRefresh )
{
  QgsDebugMsg( " identifier = " + identifier );

  QgsWcsCoverageSummary *coverage = coverageSummary( identifier );
  if ( !coverage )
  {
    QgsDebugMsg( "coverage not found" );
    return false;
  }

  if ( coverage->described && ! forceRefresh ) return true;

  QString url = getDescribeCoverageUrl( coverage->identifier );

  if ( !sendRequest( url ) )
  {
    return false;
  }

  QgsDebugMsg( "Converting to Dom." );

  bool domOK = false;
  if ( mVersion.startsWith( QLatin1String( "1.0" ) ) )
  {
    domOK = parseDescribeCoverageDom10( mCapabilitiesResponse, coverage );
  }
  else if ( mVersion.startsWith( QLatin1String( "1.1" ) ) )
  {
    domOK = parseDescribeCoverageDom11( mCapabilitiesResponse, coverage );
  }

  if ( !domOK )
  {
    // We had an Dom exception -
    // mErrorTitle and mError are pre-filled by parseCapabilitiesDom

    mError += tr( "\nTried URL: %1" ).arg( url );

    QgsDebugMsg( "!domOK: " + mError );

    return false;
  }

  return true;
}