2 changes: 1 addition & 1 deletion src/providers/wcs/qgswcscapabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom10( QByteArray const &xml, QgsW

// may be GTiff, GeoTIFF, TIFF, GIF, ....
coverage->supportedFormat = domElementsTexts( coverageOfferingElement, "supportedFormats.formats" );
//QgsDebugMsg( "supportedFormat = " + coverage->supportedFormat.join( "," ) );
QgsDebugMsg( "supportedFormat = " + coverage->supportedFormat.join( "," ) );

// spatialDomain and Grid/RectifiedGrid are optional according to specificationi.
// If missing, we cannot get native resolution and size.
Expand Down
10 changes: 8 additions & 2 deletions src/providers/wcs/qgswcsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,17 @@ void QgsWcsProvider::cacheReplyFinished()
QgsDebugMsg( "contentType: " + contentType );

// Exception
// Content type examples: text/xml
// application/vnd.ogc.se_xml;charset=UTF-8
// application/xml
if ( contentType.startsWith( "text/", Qt::CaseInsensitive ) ||
contentType.toLower() == "application/vnd.ogc.se_xml" )
contentType.toLower() == "application/xml" ||
contentType.startsWith( "application/vnd.ogc.se_xml", Qt::CaseInsensitive ) )
{
QByteArray text = mCacheReply->readAll();
if (( contentType.toLower() == "text/xml" || contentType.toLower() == "application/vnd.ogc.se_xml" )
if (( contentType.toLower() == "text/xml" ||
contentType.toLower() == "application/xml" ||
contentType.startsWith( "application/vnd.ogc.se_xml", Qt::CaseInsensitive ) )
&& parseServiceExceptionReportDom( text ) )
{
QgsMessageLog::logMessage( tr( "Map request error (Title:%1; Error:%2; URL: %3)" )
Expand Down
350 changes: 246 additions & 104 deletions tests/src/providers/testqgswcspublicservers.cpp

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions tests/src/providers/testqgswcspublicservers.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TestQgsWcsPublicServers: public QObject
// Known problem
struct Issue
{
QString offender; // server or empty == qgis
QStringList versions; // version regex
QStringList coverages; // coverage regex
QString description; // problem description
Expand All @@ -45,24 +46,37 @@ class TestQgsWcsPublicServers: public QObject
Server( ) {}
Server( const QString & u ) : url( u ) {}
QString url; // URL
QString description; // notes
QList<TestQgsWcsPublicServers::Issue> issues;
};

enum OffenderType
{
NoOffender = 0,
ServerOffender = 1,
QGisOffender = 1 << 1
};

TestQgsWcsPublicServers( const QString & cacheDirPath, int maxCoverages, const QString & server = QString(), const QString & coverage = QString(), const QString &version = QString(), bool force = false );

void init();
void test();
void report();
private:
QString cells( QStringList theValues, QString theClass = QString(), int colspan = 1 );
QString row( QStringList theValues, QString theClass = QString() );
QString error( QString theMessage );
void writeReport( QString theReport );

QMap<QString, QString> readLog( QString theFileName );

Server getServer( const QString & url );

QList<Issue> issues( const QString & url, const QString & coverage, const QString &version );
QStringList issueDescriptions( const QString & url, const QString & coverage, const QString &version );

int issueOffender( const QString & url, const QString & coverage, const QString &version );

QString mCacheDirPath;
QDir mCacheDir;

Expand Down
26 changes: 24 additions & 2 deletions tests/src/providers/wcs-servers.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
[
{
url: 'http://demo.opengeo.org/geoserver/wcs',
description: 'Does not work at all with gvSIG-1_11-1305-final.',
issues: [
{
offender: 'server',
coverages: [ 'og:0' ],
versions: [ ],
description: 'Server fails on DescribeCoverage with: java.io.IOException null Translator error Unexpected error occurred during describe coverage xml encoding ...'
versions: [ '1.0.0' ],
description: 'The server fails in DescribeCoverage with: java.io.IOException null Translator error Unexpected error occurred during describe coverage xml encoding ...'
},{
offender: 'server',
coverages: [ 'bm' ],
versions: [ '1.1.0' ],
description: 'The server fails in DescribeCoverage with: java.io.IOException null Translator error Unexpected error occurred during describe coverage xml encoding ...'
},{
offender: 'server',
coverages: [ 'usgs:nlcd', 'nlcd' ],
versions: [ '1.0.0', '1.1.0' ],
description: 'The server does no offer any CRS in DescribeCoverage supportedCRSs / supportedCRS. QGIS tries to get coverage using EPSG:5070, in which the coverage spatialDomain.Envelope is defined, but server fails reporting error: Could not recognize crs ...'
},{
offender: 'server',
coverages: [ '0', 'naturalearth' ],
versions: [ '1.1.0' ],
description: "The server fails in GetCoverage with 'java.lang.IllegalArgumentException: xScale:the parameter value is not valid. xScale:the parameter value is not valid.' It fails with BOUNDINGBOX=-2,-6,2,6&GRIDORIGIN=2,-6&GRIDOFFSETS=-2,3 but works with BOUNDINGBOX=-2,-6,2,6&GRIDORIGIN=2,-6&GRIDOFFSETS=2,-3 (GRIDOFFSETS signs switched) other coverages (Arc_Sample e.g.) work OK with the first"
},{
offender: 'server',
coverages: [ 'Img_Sample' ],
versions: [ '1.1.0' ],
description: "The server fails in GetCoverage with 'java.lang.IllegalArgumentException: The specified dimensional parameter is non-positive. The specified dimensional parameter is non-positive'."
}
]
}, {
Expand Down