@@ -171,6 +171,8 @@ bool QgsWmsCapabilities::parseResponse( const QByteArray& response, const QgsWms
171
171
format = QgsRaster::IdentifyFormatFeature; // 1.0
172
172
else if ( f == " application/vnd.ogc.gml" )
173
173
format = QgsRaster::IdentifyFormatFeature;
174
+ else if ( f == " application/json" )
175
+ format = QgsRaster::IdentifyFormatFeature;
174
176
else if ( f.contains ( " gml" , Qt::CaseInsensitive ) )
175
177
format = QgsRaster::IdentifyFormatFeature;
176
178
@@ -349,7 +351,7 @@ void QgsWmsCapabilities::parseOnlineResource( QDomElement const & e, QgsWmsOnlin
349
351
{
350
352
QgsDebugMsg ( " entering." );
351
353
352
- onlineResourceAttribute.xlinkHref = e.attribute ( " xlink:href" );
354
+ onlineResourceAttribute.xlinkHref = QUrl::fromEncoded ( e.attribute ( " xlink:href" ). toUtf8 () ). toString ( );
353
355
354
356
QgsDebugMsg ( " exiting." );
355
357
}
@@ -1470,7 +1472,36 @@ void QgsWmsCapabilities::parseWMTSContents( QDomElement const &e )
1470
1472
1471
1473
for ( QDomElement e1 = e0 .firstChildElement ( " InfoFormat" ); !e1 .isNull (); e1 = e1 .nextSiblingElement ( " InfoFormat" ) )
1472
1474
{
1475
+ QString format = e1 .text ();
1476
+
1473
1477
l.infoFormats << e1 .text ();
1478
+
1479
+ QgsRaster::IdentifyFormat fmt = QgsRaster::IdentifyFormatUndefined;
1480
+
1481
+ QgsDebugMsg ( QString ( " format=%1" ).arg ( format ) );
1482
+
1483
+ if ( format == " MIME" )
1484
+ fmt = QgsRaster::IdentifyFormatText; // 1.0
1485
+ else if ( format == " text/plain" )
1486
+ fmt = QgsRaster::IdentifyFormatText;
1487
+ else if ( format == " text/html" )
1488
+ fmt = QgsRaster::IdentifyFormatHtml;
1489
+ else if ( format.startsWith ( " GML." ) )
1490
+ fmt = QgsRaster::IdentifyFormatFeature; // 1.0
1491
+ else if ( format == " application/vnd.ogc.gml" )
1492
+ fmt = QgsRaster::IdentifyFormatFeature;
1493
+ else if ( format.contains ( " gml" , Qt::CaseInsensitive ) )
1494
+ fmt = QgsRaster::IdentifyFormatFeature;
1495
+ else if ( format == " application/json" )
1496
+ fmt = QgsRaster::IdentifyFormatFeature;
1497
+ else
1498
+ {
1499
+ QgsDebugMsg ( QString ( " Unsupported featureInfoUrl format: %1" ).arg ( format ) );
1500
+ continue ;
1501
+ }
1502
+
1503
+ QgsDebugMsg ( QString ( " fmt=%1" ).arg ( fmt ) );
1504
+ mIdentifyFormats .insert ( fmt, format );
1474
1505
}
1475
1506
1476
1507
for ( QDomElement e1 = e0 .firstChildElement ( " Dimension" ); !e1 .isNull (); e1 = e1 .nextSiblingElement ( " Dimension" ) )
@@ -1595,6 +1626,33 @@ void QgsWmsCapabilities::parseWMTSContents( QDomElement const &e )
1595
1626
else if ( resourceType == " FeatureInfo" )
1596
1627
{
1597
1628
l.getFeatureInfoURLs .insert ( format, tmpl );
1629
+
1630
+ QgsRaster::IdentifyFormat fmt = QgsRaster::IdentifyFormatUndefined;
1631
+
1632
+ QgsDebugMsg ( QString ( " format=%1" ).arg ( format ) );
1633
+
1634
+ if ( format == " MIME" )
1635
+ fmt = QgsRaster::IdentifyFormatText; // 1.0
1636
+ else if ( format == " text/plain" )
1637
+ fmt = QgsRaster::IdentifyFormatText;
1638
+ else if ( format == " text/html" )
1639
+ fmt = QgsRaster::IdentifyFormatHtml;
1640
+ else if ( format.startsWith ( " GML." ) )
1641
+ fmt = QgsRaster::IdentifyFormatFeature; // 1.0
1642
+ else if ( format == " application/vnd.ogc.gml" )
1643
+ fmt = QgsRaster::IdentifyFormatFeature;
1644
+ else if ( format.contains ( " gml" , Qt::CaseInsensitive ) )
1645
+ fmt = QgsRaster::IdentifyFormatFeature;
1646
+ else if ( format == " application/json" )
1647
+ fmt = QgsRaster::IdentifyFormatFeature;
1648
+ else
1649
+ {
1650
+ QgsDebugMsg ( QString ( " Unsupported featureInfoUrl format: %1" ).arg ( format ) );
1651
+ continue ;
1652
+ }
1653
+
1654
+ QgsDebugMsg ( QString ( " fmt=%1" ).arg ( fmt ) );
1655
+ mIdentifyFormats .insert ( fmt, format );
1598
1656
}
1599
1657
else
1600
1658
{
0 commit comments