Skip to content
Permalink
Browse files

[processing] repair non-working random extract algorithms (fix #11571)

  • Loading branch information
alexbruy committed Nov 19, 2014
1 parent 5e6f4c2 commit 3c2d45ffd7b12e85d836f6684013a0e70228eeed
@@ -85,9 +85,8 @@ def processAlgorithm(self, progress):

selran = random.sample(xrange(0, featureCount), value)

output = self.getOutputFromName(self.OUTPUT)
writer = output.getVectorWriter(layer.fields(),
layer.geometryType(), layer.crs())
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
layer.pendingFields().toList(), layer.wkbType(), layer.crs())

for (i, feat) in enumerate(features):
if i in selran:
@@ -91,10 +91,8 @@ def processAlgorithm(self, progress):
value and try again.")
value = value / 100.0


output = self.getOutputFromName(self.OUTPUT)
writer = output.getVectorWriter(layer.fields(),
layer.geometryType(), layer.crs())
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
layer.pendingFields().toList(), layer.wkbType(), layer.crs())

selran = []
current = 0

0 comments on commit 3c2d45f

Please sign in to comment.
You can’t perform that action at this time.