Skip to content

Commit 9ae12c8

Browse files
committed
fix typo
1 parent c56915c commit 9ae12c8

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

src/core/qgsvectorlayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ struct CORE_EXPORT QgsVectorJoinInfo
218218
* - version=auto/1.0.0/1.1.0/2.0.0
219219
* -sql=string: full SELECT SQL statement with optional WHERE, ORDER BY and possibly with JOIN if supported on server
220220
* - filter=string: QGIS expression or OGC/FES filter
221-
* - retrictToRequestBBOX=1: to download only features in the view extent (or more generally
221+
* - restrictToRequestBBOX=1: to download only features in the view extent (or more generally
222222
* in the bounding box of the feature iterator)
223223
* - maxNumFeatures=number
224224
* - IgnoreAxisOrientation=1: to ignore EPSG axis order for WFS 1.1 or 2.0

src/providers/wfs/qgswfsconstants.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const QString QgsWFSConstants::URI_PARAM_TYPENAME( "typename" );
3131
const QString QgsWFSConstants::URI_PARAM_SRSNAME( "srsname" );
3232
const QString QgsWFSConstants::URI_PARAM_BBOX( "bbox" );
3333
const QString QgsWFSConstants::URI_PARAM_FILTER( "filter" );
34-
const QString QgsWFSConstants::URI_PARAM_RESTRICT_TO_REQUEST_BBOX( "retrictToRequestBBOX" );
34+
const QString QgsWFSConstants::URI_PARAM_RESTRICT_TO_REQUEST_BBOX( "restrictToRequestBBOX" );
3535
const QString QgsWFSConstants::URI_PARAM_MAXNUMFEATURES( "maxNumFeatures" );
3636
const QString QgsWFSConstants::URI_PARAM_IGNOREAXISORIENTATION( "IgnoreAxisOrientation" );
3737
const QString QgsWFSConstants::URI_PARAM_INVERTAXISORIENTATION( "InvertAxisOrientation" );

src/providers/wfs/qgswfsdatasourceuri.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,15 @@ void QgsWFSDataSourceURI::setSql( const QString& sql )
193193

194194
bool QgsWFSDataSourceURI::isRestrictedToRequestBBOX() const
195195
{
196-
return mURI.hasParam( QgsWFSConstants::URI_PARAM_RESTRICT_TO_REQUEST_BBOX ) &&
197-
mURI.param( QgsWFSConstants::URI_PARAM_RESTRICT_TO_REQUEST_BBOX ).toInt() == 1;
196+
if ( mURI.hasParam( QgsWFSConstants::URI_PARAM_RESTRICT_TO_REQUEST_BBOX ) &&
197+
mURI.param( QgsWFSConstants::URI_PARAM_RESTRICT_TO_REQUEST_BBOX ).toInt() == 1 )
198+
return true;
199+
200+
// accept previously used version with typo
201+
if ( mURI.hasParam( "retrictToRequestBBOX" ) && mURI.param( "retrictToRequestBBOX" ).toInt() == 1 )
202+
return true;
203+
204+
return false;
198205
}
199206

200207
bool QgsWFSDataSourceURI::ignoreAxisOrientation() const

tests/src/python/test_provider_wfs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ def testWFSGetOnlyFeaturesInViewExtent(self):
892892
""".encode('UTF-8'))
893893

894894
# Create test layer
895-
vl = QgsVectorLayer(u"url='http://" + endpoint + u"' typename='my:typename' retrictToRequestBBOX=1", u'test', u'WFS')
895+
vl = QgsVectorLayer(u"url='http://" + endpoint + u"' typename='my:typename' restrictToRequestBBOX=1", u'test', u'WFS')
896896
assert vl.isValid()
897897
self.assertEqual(vl.wkbType(), QgsWKBTypes.Point)
898898

@@ -1872,8 +1872,8 @@ def testWrongCapabilityExtent(self):
18721872
vl_extent = QgsGeometry.fromRect(vl.extent())
18731873
assert QgsGeometry.compare(vl_extent.asPolygon()[0], reference.asPolygon()[0], 0.00001), 'Expected {}, got {}'.format(reference.exportToWkt(), vl_extent.exportToWkt())
18741874

1875-
# Same with retrictToRequestBBOX=1
1876-
vl = QgsVectorLayer(u"url='http://" + endpoint + u"' typename='my:typename' version='2.0.0' retrictToRequestBBOX=1", u'test', u'WFS')
1875+
# Same with restrictToRequestBBOX=1
1876+
vl = QgsVectorLayer(u"url='http://" + endpoint + u"' typename='my:typename' version='2.0.0' restrictToRequestBBOX=1", u'test', u'WFS')
18771877
assert vl.isValid()
18781878

18791879
# First request that will be attempted

tests/src/python/test_provider_wfs_gui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test(self):
225225
self.addWfsLayer_layer_name = None
226226
main_dialog.addWfsLayer.connect(self.slotAddWfsLayer)
227227
QTest.mouseClick(buttonAdd, Qt.LeftButton)
228-
self.assertEqual(self.addWfsLayer_uri, ' retrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\' table="" sql=')
228+
self.assertEqual(self.addWfsLayer_uri, ' restrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\' table="" sql=')
229229
self.assertEqual(self.addWfsLayer_layer_name, 'my:typename')
230230

231231
# Click on Build Query
@@ -298,7 +298,7 @@ def test(self):
298298
self.addWfsLayer_layer_name = None
299299
main_dialog.addWfsLayer.connect(self.slotAddWfsLayer)
300300
QTest.mouseClick(buttonAdd, Qt.LeftButton)
301-
self.assertEqual(self.addWfsLayer_uri, ' retrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\' table="" sql=SELECT * FROM typename WHERE 1 = 1')
301+
self.assertEqual(self.addWfsLayer_uri, ' restrictToRequestBBOX=\'1\' srsname=\'EPSG:4326\' typename=\'my:typename\' url=\'' + "http://" + expected_endpoint + '\' version=\'auto\' table="" sql=SELECT * FROM typename WHERE 1 = 1')
302302
self.assertEqual(self.addWfsLayer_layer_name, 'my:typename')
303303

304304
#main_dialog.setProperty("hideDialogs", None)

0 commit comments

Comments
 (0)