Skip to content

Commit 408e2b7

Browse files
committed
Fix #8864 (Random selection with subsampling broken)
1 parent a9be559 commit 408e2b7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

python/plugins/fTools/tools/doSubsetSelect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ def compute(self, inVect, inField, value, perc, progressBar):
9292
nElement = 0
9393
self.progressBar.setValue(0)
9494
self.progressBar.setRange(0, nFeat)
95-
fit = vprovider.getFeatures()
9695
if not len(unique) == mlayer.featureCount():
9796
for i in unique:
98-
fit.rewind()
97+
fit = vprovider.getFeatures()
9998
FIDs= []
10099
while fit.nextFeature(inFeat):
101100
atMap = inFeat.attributes()

python/plugins/processing/algs/ftools/RandomSelectionWithinSubsets.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ def processAlgorithm(self, progress):
9999
current = 0
100100
total = 100.0 / float(featureCount * len(unique))
101101

102-
features = vector.features(layer)
103-
104102
if not len(unique) == featureCount:
105103
for i in unique:
104+
features = vector.features(layer)
106105
FIDs = []
107106
for inFeat in features:
108107
attrs = inFeat.attributes()

0 commit comments

Comments
 (0)