Skip to content
Permalink
Browse files

Fix #7073

  • Loading branch information
ddanielvaz committed Jul 10, 2013
1 parent 1ebdb69 commit 1a95297c6e1d81b2d07e21fa83b9e7e4e32dcba7
Showing with 14 additions and 4 deletions.
  1. +14 −4 python/plugins/fTools/tools/doIntersectLines.py
@@ -148,6 +148,7 @@ def compute(self, line1, line2, field1, field2, outPath, progressBar):

index = ftools_utils.createIndex( provider2 )

singlelayer_tempList = []
fit1 = provider1.getFeatures( QgsFeatureRequest().setSubsetOfAttributes([index1]) )
while fit1.nextFeature(inFeat):
inGeom = inFeat.geometry()
@@ -169,10 +170,19 @@ def compute(self, line1, line2, field1, field2, outPath, progressBar):
tempList.append(tempGeom.asPoint())

for j in tempList:
outFeat.setGeometry(tempGeom.fromPoint(j))
outFeat.setAttribute(0, v1)
outFeat.setAttribute(1, v2)
writer.addFeature(outFeat)
# if same layer, avoid insert duplicated points
if line1 == line2:
if not j in singlelayer_tempList:
singlelayer_tempList.append(j)
outFeat.setGeometry(tempGeom.fromPoint(j))
outFeat.setAttribute(0, v1)
outFeat.setAttribute(1, v2)
writer.addFeature(outFeat)
else:
outFeat.setGeometry(tempGeom.fromPoint(j))
outFeat.setAttribute(0, v1)
outFeat.setAttribute(1, v2)
writer.addFeature(outFeat)

start = start + add
progressBar.setValue(start)

0 comments on commit 1a95297

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