Bug report #7073
Intersection Tool Produces two Intersection points on the same position when performed on Same Layer
|Affected QGIS version:||master||Regression?:|
|Operating System:||Ubuntu Linux||Easy fix?:|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16157|
Platform Used: Ubuntu Linux 32-bit
The Intersection tool when performed on the same layer produces two intersection points overlapping each other.
Their attribute table data for the intersected points is something like this:
#3 Updated by Giovanni Manghi over 9 years ago
Matthias Kuhn wrote:
Is this bugreport still valid after #7021 has been fixed?
yes, because the result layer is empty.
Moreover if the tool is run using two different shapes I get
Traceback (most recent call last):
File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doIntersectLines.py", line 96, in accept
self.compute(line1, line2, field1, field2, outPath, self.progressBar)
File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doIntersectLines.py", line 169, in compute
I get the same error when running the tool using postgis layers.
#4 Updated by Daniel Vaz over 9 years ago
- File doIntersectLines.diff added
When lines are in the same layer, I think that there is a problem using the same provider to iterate over both lines. There is a strange behaviour, I don't know why, but it looks like that code:
overriden the provider1, so in the loop:
the attribute map of each feature (inFeat.attributeMap()) is an empty dict.
The patch attached includes the patch proposed by Sibi and adds a HACK that solves the problem, but it's not the correct way, I think.