Skip to content

Commit

Permalink
Merge pull request #2247 from spencerrecneps/master
Browse files Browse the repository at this point in the history
[Processing] Fixed bad variable references
  • Loading branch information
volaya committed Aug 20, 2015
2 parents bf7cf6a + 94d3bdd commit 3ff3b02
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##Distance=number 1
##Startpoint=number 0
##Endpoint=number 0
##Points along lines=output vector
##output=output vector

from PyQt4.QtCore import QVariant
from qgis.core import QGis, QgsFeature, QgsField
Expand All @@ -15,22 +15,22 @@ def create_points(feat):
length = geom.length()
currentdistance = 0

if endpoint > 0:
length = endpoint
if Endpoint > 0:
length = Endpoint

out = QgsFeature()

while startpoint + currentdistance <= length:
point = geom.interpolate(startpoint + currentdistance)
currentdistance = currentdistance + distance
while Startpoint + currentdistance <= length:
point = geom.interpolate(Startpoint + currentdistance)
currentdistance = currentdistance + Distance
out.setGeometry(point)
attrs = feat.attributes()
attrs.append(currentdistance)
out.setAttributes(attrs)
writer.addFeature(out)


layer = processing.getObject(lines)
layer = processing.getObject(Lines)
fields = layer.dataProvider().fields()
fields.append(QgsField('Distance', QVariant.Double))
writer = VectorWriter(output, None, fields, QGis.WKBPoint,
Expand Down

0 comments on commit 3ff3b02

Please sign in to comment.