@@ -130,6 +130,7 @@ void QgsWmsProvider::parseUri( QString uri )
130
130
mIgnoreGetMapUrl = false ;
131
131
mIgnoreGetFeatureInfoUrl = false ;
132
132
mIgnoreAxisOrientation = false ;
133
+ mInvertAxisOrientation = false ;
133
134
134
135
QString layer;
135
136
@@ -179,6 +180,10 @@ void QgsWmsProvider::parseUri( QString uri )
179
180
{
180
181
mIgnoreAxisOrientation = true ;
181
182
}
183
+ else if ( param == " InvertAxisOrientation" )
184
+ {
185
+ mInvertAxisOrientation = true ;
186
+ }
182
187
}
183
188
}
184
189
else if ( item.startsWith ( " tileMatrixSet=" ) )
@@ -550,6 +555,9 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
550
555
}
551
556
}
552
557
558
+ if ( mInvertAxisOrientation )
559
+ changeXY = !changeXY;
560
+
553
561
// compose the URL query string for the WMS server.
554
562
QString crsKey = " SRS" ; // SRS in 1.1.1 and CRS in 1.3.0
555
563
if ( mCapabilities .version == " 1.3.0" || mCapabilities .version == " 1.3" )
@@ -2529,12 +2537,16 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
2529
2537
2530
2538
s.crs = crs.authid ();
2531
2539
2540
+ bool invert = !mIgnoreAxisOrientation && crs.axisInverted ();
2541
+ if ( mInvertAxisOrientation )
2542
+ invert = !invert;
2543
+
2532
2544
QgsDebugMsg ( QString ( " tilematrix set: %1 (supportedCRS:%2 crs:%3; metersPerUnit:%4 axisInverted:%5)" )
2533
2545
.arg ( s.identifier )
2534
2546
.arg ( supportedCRS )
2535
2547
.arg ( s.crs )
2536
2548
.arg ( metersPerUnit, 0 , ' f' )
2537
- .arg ( ! mIgnoreAxisOrientation && crs. axisInverted () ? " yes" : " no" )
2549
+ .arg ( invert ? " yes" : " no" )
2538
2550
);
2539
2551
2540
2552
for ( QDomNode n1 = n0.firstChildElement ( " TileMatrix" );
@@ -2553,7 +2565,7 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
2553
2565
QStringList topLeft = n1.firstChildElement ( " TopLeftCorner" ).text ().split ( " " );
2554
2566
if ( topLeft.size () == 2 )
2555
2567
{
2556
- if ( ! mIgnoreAxisOrientation && crs. axisInverted () )
2568
+ if ( invert )
2557
2569
{
2558
2570
m.topLeft .set ( topLeft[1 ].toDouble (), topLeft[0 ].toDouble () );
2559
2571
}
@@ -3733,6 +3745,9 @@ QStringList QgsWmsProvider::identifyAs( const QgsPoint& point, QString format )
3733
3745
}
3734
3746
}
3735
3747
3748
+ if ( mInvertAxisOrientation )
3749
+ changeXY = !changeXY;
3750
+
3736
3751
// compose the URL query string for the WMS server.
3737
3752
QString crsKey = " SRS" ; // SRS in 1.1.1 and CRS in 1.3.0
3738
3753
if ( mCapabilities .version == " 1.3.0" || mCapabilities .version == " 1.3" )
0 commit comments