6

I'm creating a single sided buffer in QGIS based on line segments. In the project the line segments represent river shore lines. Therefore, they are often of meandering shape.

I used the algorithms 'native:singlesidedbuffer' and 'gdal:onesidebuffer' from the toolbox to generate the buffer encountering the same unsatisfying result as parts of the buffer also appear on the wrong side of the line: enter image description here

In my understanding the buffer should not exceed the line segment, when generated on one side only. I could work around this issue with trimming the buffer but would rather generate a valid buffer geometry in the first place.

Data download link: https://www.dropbox.com/s/tyim9iid40ke000/baseline.zip?dl=0; EPSG:31287;

PS: I stumbled across this thread adressing the same issue over 3 years ago (Single Sided Buffer Error QGIS) which got closed and does not provide an answer.

8
  • 1
    Can you share your data for testing purposes? Which CRS do you use?
    – Taras
    Dec 16, 2021 at 9:26
  • is your geometry valid?
    – Ian Turton
    Dec 16, 2021 at 9:32
  • @Taras: I added a download link to the line data in the question. It's in EPSG:31287.
    – r.bs
    Dec 16, 2021 at 9:37
  • 1
    Maybe it is a bug. Perhaps you should report about it here: github.com/qgis/QGIS/issues. 'Side' Right works well! As a workaround you may try to [1] create a simple buffer around the line [2] create a single sided buffer (Right ) and then [3] use the difference between [1] and [2]
    – Taras
    Dec 16, 2021 at 9:59
  • 1
    This is a flaw in the JTS/GEOS single-sided buffer algorithm. Not sure what a suitable fix is at this time.
    – dr_jts
    Dec 16, 2021 at 22:36

1 Answer 1

6

I made some tests with PostGIS and OpenJUMP and they give identical results so I conclude that the algorithm that does the job comes from the JTS and GEOS libraries. Algorithm seem to compute the buffer and trim the full buffer by the original geometry for getting the one sided buffer. Algorithm obviously do not make a second pass and trim also the single sided buffer by the original geometry but I am not sure if this is an error. After all the 40 m left side buffer in the last image covers just that area. If farmer is spraying herbicides with 40 m working width the result is very useful, some of the chemicals are spread into the nature.

select ST_Buffer(ST_GeomFromText('LINESTRING ( 295 381, 272 321, 261 275, 289 248, 319 297, 331 351, 352 373, 381 363, 376 327, 350 283, 340 241, 368 233, 383 286, 421 355, 443 341, 420 291, 413 275 )'),
40,'side=left');

The geometry:

enter image description here

With 20 m buffer

enter image description here

With 40 m buffer

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.