Skip to content

Commit e7e9ba0

Browse files
committed
[processing] Add test, help for create spatial index alg
1 parent 7a7f119 commit e7e9ba0

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎python/plugins/processing/algs/help/qgis.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ qgis:createpointsalonglines: >
114114

115115
Start and end points can be defined, so the first and last point do not fall on the line first and last node. Start and end points are defined as distances, mesaureed from the first and last nodes of the lines, in the units of the projection used by the lines layer.
116116

117+
qgis:createspatialindex: >
118+
Creates an index to speed up access to the features in a layer based on their spatial location. Support for spatial index creation is dependent on the layer's data provider.
119+
117120
qgis:delaunaytriangulation: >
118121
This algorithm creates a polygon layer with the delaunay triangulation corresponding to a points layer.
119122

‎python/plugins/processing/algs/qgis/SpatialIndex.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def processAlgorithm(self, progress):
6262

6363
if provider.capabilities() & QgsVectorDataProvider.CreateSpatialIndex:
6464
if not provider.createSpatialIndex():
65-
progress.setInfo(self.tr('Can not create spatial index'))
65+
progress.setInfo(self.tr('Could not create spatial index'))
6666
else:
6767
progress.setInfo(self.tr("Layer's data provider does not support "
6868
"spatial indexes"))

‎python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,3 +2104,17 @@ tests:
21042104
name: expected/create_attr_index_points.shp
21052105
type: vector
21062106
in_place_result: true
2107+
2108+
- algorithm: qgis:createspatialindex
2109+
name: Create spatial index
2110+
params:
2111+
INPUT:
2112+
name: custom/points.shp
2113+
type: vector
2114+
in_place: true
2115+
results:
2116+
INPUT:
2117+
name: expected/create_attr_index_points.shp
2118+
type: vector
2119+
in_place_result: true
2120+

0 commit comments

Comments
 (0)