mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
fixed bad variable references
This commit is contained in:
parent
abf2398880
commit
94d3bdd01a
@ -3,7 +3,7 @@
|
|||||||
##Distance=number 1
|
##Distance=number 1
|
||||||
##Startpoint=number 0
|
##Startpoint=number 0
|
||||||
##Endpoint=number 0
|
##Endpoint=number 0
|
||||||
##Points along lines=output vector
|
##output=output vector
|
||||||
|
|
||||||
from PyQt4.QtCore import QVariant
|
from PyQt4.QtCore import QVariant
|
||||||
from qgis.core import QGis, QgsFeature, QgsField
|
from qgis.core import QGis, QgsFeature, QgsField
|
||||||
@ -15,14 +15,14 @@ def create_points(feat):
|
|||||||
length = geom.length()
|
length = geom.length()
|
||||||
currentdistance = 0
|
currentdistance = 0
|
||||||
|
|
||||||
if endpoint > 0:
|
if Endpoint > 0:
|
||||||
length = endpoint
|
length = Endpoint
|
||||||
|
|
||||||
out = QgsFeature()
|
out = QgsFeature()
|
||||||
|
|
||||||
while startpoint + currentdistance <= length:
|
while Startpoint + currentdistance <= length:
|
||||||
point = geom.interpolate(startpoint + currentdistance)
|
point = geom.interpolate(Startpoint + currentdistance)
|
||||||
currentdistance = currentdistance + distance
|
currentdistance = currentdistance + Distance
|
||||||
out.setGeometry(point)
|
out.setGeometry(point)
|
||||||
attrs = feat.attributes()
|
attrs = feat.attributes()
|
||||||
attrs.append(currentdistance)
|
attrs.append(currentdistance)
|
||||||
@ -30,7 +30,7 @@ def create_points(feat):
|
|||||||
writer.addFeature(out)
|
writer.addFeature(out)
|
||||||
|
|
||||||
|
|
||||||
layer = processing.getObject(lines)
|
layer = processing.getObject(Lines)
|
||||||
fields = layer.dataProvider().fields()
|
fields = layer.dataProvider().fields()
|
||||||
fields.append(QgsField('Distance', QVariant.Double))
|
fields.append(QgsField('Distance', QVariant.Double))
|
||||||
writer = VectorWriter(output, None, fields, QGis.WKBPoint,
|
writer = VectorWriter(output, None, fields, QGis.WKBPoint,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user