Bug report #6925
Eliminate slivers polygon creates wrong output
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | Bernhard Ströbl | ||
Category: | Processing/QGIS | ||
Affected QGIS version: | master | Regression?: | |
Operating System: | Easy fix?: | ||
Pull Request or Patch supplied: | No | Resolution: | fixed |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 16043 |
Description
pick the attached shape, then select the polygon with attribute "cat = 36" and try the tool, it will say it can't do the operation.
The shape seems to have no errors, and if imported into postgis then the tool will work as expected.
Associated revisions
fix #6925
fTools' eliminate now works if the polygon to merge with has an id of 0
History
#1 Updated by Bernhard Ströbl almost 12 years ago
I made a pull request that fixes the case that the polygon to merge with has id=0: https://github.com/qgis/Quantum-GIS/pull/371
#2 Updated by Werner Macho almost 12 years ago
- Status changed from Open to Closed
Fixed in changeset 71580df366401df4bee9942c099f541796ed90f3.
#3 Updated by Giovanni Manghi almost 12 years ago
- File lixo.zip added
- Status changed from Closed to Reopened
- File result.jpg added
- File castqgis.ogg added
Hi Bernhard,
I just noticed that seems the last fixed caused a pretty bad regression in the tool.
Add the attached sample shape and then make a selection using this expression (or even a simpler one):
("USO_SOLO" = 'LE') OR ("USO_SOLO"='PEDR')OR ("USO_SOLO" = 'LAV') OR ("USO_SOLO"='MATOS') OR ("USO_SOLO"='SEBE_ARV') OR ("USO_SOLO"='ETB') OR ("USO_SOLO"='LA') OR ("USO_SOLO"='LA_GR') OR ("USO_SOLO"='EA') OR ("USO_SOLO"='AUTOESTRADA')
then run the tool.
The result (attached screenshot) is a shape where many polygons where lost, and if you give the vector a little transparency you'll see that a few polygons are now duplicated.
Moreover in the result there are strange "structures" that when edited are revealed as tringular flattened holes (notice that the input layer is topologically correct, it has been checked with GRASS, so such "structures" are really not expected). See attached screencast.
Note:
the tool before the last fix does not produce such missing/duplicated polygons, but also does not produce the right result (with the above selection).
#4 Updated by Giovanni Manghi almost 12 years ago
- Subject changed from Eliminate slivers polygon tool fail to remove a particular polygon to Eliminate slivers polygon creates wrong output
#5 Updated by Bernhard Ströbl almost 12 years ago
Giovanni,
thanks for thorough testing!
I even get the wrong result when undoing the last fix. So the good message: it is not a regression :-)
#6 Updated by Giovanni Manghi almost 12 years ago
thanks for thorough testing!
you welcome! but this is a so useful tool that it is not easy NOT test it :)
I even get the wrong result when undoing the last fix.
do you mean the missing/duplicated polygon?
I don't, but instead the attributes of the result layer are mixed up, so it is still wrong, but just on the attributes side.
#7 Updated by Bernhard Ströbl almost 12 years ago
Giovanni Manghi wrote:
do you mean the missing/duplicated polygon?
I don't, but instead the attributes of the result layer are mixed up, so it is still wrong, but just on the attributes side.
I mean my result looks the very same using current master and undoing my fix in current master. Are you on current master? Did not check attributes, though.
#8 Updated by Bernhard Ströbl almost 12 years ago
Giovanni,
I redid my code, and issued a pull request containing the changes. Give it a try with your data.
During my analysis I discovered your data are not really topologically correct: Adjacent polygons do not always share the same nodes, some nodes are missing in one of the two polygons. This results in useless line fragments within polygons after running eliminate. I fixed your data by running v.clean tool=break
in GRASS.
#9 Updated by Alexander Bruy almost 12 years ago
- Status changed from Reopened to Closed
Fixed in changeset 07772f13f6ac102dd18eccf68d350f6bafeef4c8.
#10 Updated by Alexander Bruy almost 12 years ago
- Resolution set to fixed
#11 Updated by Giovanni Manghi almost 12 years ago
Bernhard Ströbl wrote:
Giovanni,
I redid my code, and issued a pull request containing the changes. Give it a try with your data.
During my analysis I discovered your data are not really topologically correct: Adjacent polygons do not always share the same nodes, some nodes are missing in one of the two polygons. This results in useless line fragments within polygons after running eliminate. I fixed your data by runningv.clean tool=break
in GRASS.
Thanks!
well... if it wasn't clean (then I missed something when using grass) then the "strange" results are understandable.
After rewriting the tool code does it works with the provided sample? I'm asking just because I'm with of lack of time to test in there days.
cheers!
#12 Updated by Bernhard Ströbl almost 12 years ago
- File elim.zip added
Giovanni Manghi wrote:
well... if it wasn't clean (then I missed something when using grass) then the "strange" results are understandable.
No, the strange results (holes and overlaps) where caused by the code. I have described all that was caused by the data not being clean in message 8 above
Giovanni Manghi wrote:
After rewriting the tool code does it works with the provided sample? I'm asking just because I'm with of lack of time to test in there days.
It worked with the sample data. I attached the resulting shape file.
#13 Updated by Giovanni Manghi over 7 years ago
The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.