@@ -1724,6 +1724,25 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay
1724
1724
e1 .attribute ( " maxx" ).toDouble (),
1725
1725
e1 .attribute ( " maxy" ).toDouble ()
1726
1726
);
1727
+
1728
+ if ( e1 .hasAttribute ( " SRS" ) && e1 .attribute ( " SRS" ) != DEFAULT_LATLON_CRS )
1729
+ {
1730
+ try
1731
+ {
1732
+ QgsCoordinateReferenceSystem src;
1733
+ src.createFromOgcWmsCrs ( e1 .attribute ( " SRS" ) );
1734
+
1735
+ QgsCoordinateReferenceSystem dst;
1736
+ dst.createFromOgcWmsCrs ( DEFAULT_LATLON_CRS );
1737
+
1738
+ QgsCoordinateTransform ct ( src, dst );
1739
+ layerProperty.ex_GeographicBoundingBox = ct.transformBoundingBox ( layerProperty.ex_GeographicBoundingBox );
1740
+ }
1741
+ catch ( QgsCsException &cse )
1742
+ {
1743
+ Q_UNUSED ( cse );
1744
+ }
1745
+ }
1727
1746
}
1728
1747
else if ( e1 .tagName () == " EX_GeographicBoundingBox" ) // for WMS 1.3
1729
1748
{
@@ -1751,8 +1770,19 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay
1751
1770
e1 .attribute ( " maxx" ).toDouble (),
1752
1771
e1 .attribute ( " maxy" ).toDouble ()
1753
1772
);
1754
- bbox.crs = e1 .attribute ( " CRS" );
1755
- layerProperty.boundingBox .push_back ( bbox );
1773
+ if ( e1 .hasAttribute ( " CRS" ) || e1 .hasAttribute ( " SRS" ) )
1774
+ {
1775
+ if ( e1 .hasAttribute ( " CRS" ) )
1776
+ bbox.crs = e1 .attribute ( " CRS" );
1777
+ else if ( e1 .hasAttribute ( " SRS" ) )
1778
+ bbox.crs = e1 .attribute ( " SRS" );
1779
+
1780
+ layerProperty.boundingBox .push_back ( bbox );
1781
+ }
1782
+ else
1783
+ {
1784
+ QgsDebugMsg ( " CRS/SRS attribute note found in BoundingBox" );
1785
+ }
1756
1786
}
1757
1787
else if ( e1 .tagName () == " Dimension" )
1758
1788
{
0 commit comments