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

QGIS fixed-distance buffer skips features with invalid geometry #25189

Closed
qgib opened this issue Oct 16, 2017 · 10 comments
Closed

QGIS fixed-distance buffer skips features with invalid geometry #25189

qgib opened this issue Oct 16, 2017 · 10 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

Comments

@qgib
Copy link
Contributor

qgib commented Oct 16, 2017

Author Name: Steve Lowman (Steve Lowman)
Original Redmine Issue: 17291
Affected QGIS version: 2.18.13
Redmine category:processing/qgis
Assignee: Victor Olaya


The OGR 'Buffer vectors' algorithm will buffer polygon features with most (possibly all?) kinds of geometric errors, and with a zero-distance buffer it will fix them, too. We have used this as an easy way to fix invalid geometries, and it has consistently worked.

However, the QGIS fixed-distance buffer skips features with geometric errors. There is no clear warning that features have been lost, which constitutes a risk to data security. And, it is not useful for fixing the invalid geometries, but the OGR buffer is still good for this.



Related issue(s): #25191 (relates), #25976 (duplicates)
Redmine related issue(s): 17293, 18080


@qgib
Copy link
Contributor Author

qgib commented Oct 16, 2017

Author Name: Steve Lowman (Steve Lowman)


Adding second video demo showing OGR buffer tool does not skip features with invalid geometries


  • 11558 was configured as Processing vs OGR buffer on invalid geometries Demo2.mp4

@qgib
Copy link
Contributor Author

qgib commented Oct 16, 2017

Author Name: Steve Lowman (Steve Lowman)


Cross ref to 17293. Both are about buffers, including both QGIS and OGR tools.

Also to comment, I think this may count as a regression, as the vector menu buffer tool now has this problem that was not there in the 2.14 buffer tool.

@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Jürgen Fischer (@jef-n)


@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Giovanni Manghi (@gioman)


Steve Lowman wrote:

Cross ref to 17293. Both are about buffers, including both QGIS and OGR tools.

Also to comment, I think this may count as a regression, as the vector menu buffer tool now has this problem that was not there in the 2.14 buffer tool.

that ticket is not about just the buffer tool, and anyway seems invalid (see my comments). This ticket is a about a completely different matter.

@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Giovanni Manghi (@gioman)


Steve Lowman wrote:

Adding second video demo showing OGR buffer tool does not skip features with invalid geometries

The tools (that do the same geoprocessing/analysis operation) have different origins so is expected that they can behave in slightly different ways. In this case is widely known that QGIS native geoprocessing tools until 2.18 have issues handling and reporting about geometry errors in inputs. You must check in QGIS master (where this native QGIS tools are being ported to C++) to see if anything changed. Thanks.


  • operating_system was changed from W10 to
  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Giovanni Manghi (@gioman)


If you can please also attach your sample data.

@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Steve Lowman (Steve Lowman)


Thanks Giovanni. I see this is related to #25031, which has a high priority. Sorry, I am just an LTR user and probably adopted 2.18 a bit too early with it still having bugs like this.

Adding a shapefile, the same as in the video, 76 features, of which 4 have errors that make the Fixed Distance Buffer tool skip them. They are features 22, 26, 44 and 70. The OGR Buffers tool handles them without a problem and fixes their errors when run with zero distance.


  • 11567 was configured as TestForBugs.zip

  • TestForBugs.zip (Steve Lowman) - polygon shapefile includes some features with invalid geometries for testing.

@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Steve Lowman (Steve Lowman)


Sample file and comment submitted in response to feedback, so now setting it back to 'Open'.


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Giovanni Manghi (@gioman)


Steve Lowman wrote:

Sample file and comment submitted in response to feedback, so now setting it back to 'Open'.

On 2.18.13 in the log there is the warning about the skipped geometries

2017-10-17T15:27:04 1 Feature 22 has invalid geometry. Skipping...
2017-10-17T15:27:04 1 Feature 36 has invalid geometry. Skipping...
2017-10-17T15:27:04 1 Feature 44 has invalid geometry. Skipping...
2017-10-17T15:27:04 1 Feature 70 has invalid geometry. Skipping...

and I believe that for this QGIS release is all that what could be done (this problem has been lengthy discussed in the past).
The same dataset will causes QGIS3 to lock completely, which is kind of a good news because there is the commitment to make this native qgis geoprocessing tools work correctly in QGIS3. In the meantime in QGIS 2 use more robust alternatives available in the Processing toolbox.

Closed in favor of #25031


  • resolution was changed from to wontfix
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Oct 17, 2017
@qgib
Copy link
Contributor Author

qgib commented May 7, 2018

Author Name: Alessandro Pasotti (@elpaso)


@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 25, 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