Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate slivers polygon creates wrong output #16043

Closed
qgib opened this issue Dec 28, 2012 · 13 comments
Closed

Eliminate slivers polygon creates wrong output #16043

qgib opened this issue Dec 28, 2012 · 13 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Dec 28, 2012

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 6925
Affected QGIS version: master
Redmine category:processing/qgis
Assignee: Bernhard Ströbl


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.


@qgib
Copy link
Contributor Author

qgib commented Jan 2, 2013

Author Name: Bernhard Ströbl (Bernhard Ströbl)


I made a pull request that fixes the case that the polygon to merge with has id=0: #371

@qgib
Copy link
Contributor Author

qgib commented Jan 3, 2013

Author Name: Werner Macho (Werner Macho)


Fixed in changeset "71580df366401df4bee9942c099f541796ed90f3".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jan 17, 2013

Author Name: Giovanni Manghi (@gioman)


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).


  • 5264 was configured as lixo.zip
  • status_id was changed from Closed to Reopened
  • 5265 was configured as result.jpg
  • 5266 was configured as castqgis.ogg

@qgib
Copy link
Contributor Author

qgib commented Jan 17, 2013

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from Eliminate slivers polygon tool fail to remove a particular polygon to Eliminate slivers polygon creates wrong output

@qgib
Copy link
Contributor Author

qgib commented Jan 18, 2013

Author Name: Bernhard Ströbl (Bernhard Ströbl)


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 :-)

@qgib
Copy link
Contributor Author

qgib commented Jan 18, 2013

Author Name: Giovanni Manghi (@gioman)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 18, 2013

Author Name: Bernhard Ströbl (Bernhard Ströbl)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 21, 2013

Author Name: Bernhard Ströbl (Bernhard Ströbl)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 21, 2013

Author Name: Alexander Bruy (@alexbruy)


Fixed in changeset "07772f13f6ac102dd18eccf68d350f6bafeef4c8".


  • status_id was changed from Reopened to Closed

@qgib
Copy link
Contributor Author

qgib commented Jan 21, 2013

Author Name: Alexander Bruy (@alexbruy)


  • resolution was changed from to fixed

@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2013

Author Name: Giovanni Manghi (@gioman)


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 running @v.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!

@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2013

Author Name: Bernhard Ströbl (Bernhard Ströbl)


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.


  • 5275 was configured as elim.zip

  • elim.zip (Bernhard Ströbl) - sample data after v.clean tool=break and fTools.eliminate

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 24, 2019
@qgib qgib added this to the Version 2.0.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
JamesShaeffer pushed a commit to JamesShaeffer/QGIS that referenced this issue Nov 20, 2019
Tested on GeoServer and QGIS Server

Needs forward port to master
JamesShaeffer pushed a commit to JamesShaeffer/QGIS that referenced this issue Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant