Bug report #17291

QGIS fixed-distance buffer skips features with invalid geometry

Added by Steve Lowman over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:2.18.13 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:No Copied to github as #:25189

Description

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.

Processing vs OGR buffer on invalid geometries Demo1.mp4 - Demo shows fixed distance buffer skipping features with invalid geometries, and no clear warning given. (3.44 MB) Steve Lowman, 2017-10-16 09:28 PM

Processing vs OGR buffer on invalid geometries Demo2.mp4 - Use of OGR buffer and no features are skipped. (3.29 MB) Steve Lowman, 2017-10-16 09:30 PM

TestForBugs.zip - polygon shapefile includes some features with invalid geometries for testing. (43.4 KB) Steve Lowman, 2017-10-17 04:13 PM


Related issues

Related to QGIS Application - Bug report #17293: Processing output name called after the operation name ev... Closed 2017-10-16
Duplicated by QGIS Application - Bug report #18080: Vector Fixed Distance Buffer Closed 2018-02-12

History

#1 Updated by Steve Lowman over 6 years ago

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

#2 Updated by Steve Lowman over 6 years ago

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.

#3 Updated by Jürgen Fischer over 6 years ago

  • Related to Bug report #17293: Processing output name called after the operation name even when saved to file added

#4 Updated by Giovanni Manghi over 6 years ago

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.

#5 Updated by Giovanni Manghi over 6 years ago

  • Operating System deleted (W10)
  • Status changed from Open to Feedback

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.

#6 Updated by Giovanni Manghi over 6 years ago

If you can please also attach your sample data.

#7 Updated by Steve Lowman over 6 years ago

Thanks Giovanni. I see this is related to #17132, 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.

#8 Updated by Steve Lowman over 6 years ago

  • Status changed from Feedback to Open

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

#9 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to wontfix
  • Status changed from Open to Closed

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 #17132

#10 Updated by Alessandro Pasotti almost 6 years ago

Also available in: Atom PDF