Skip to content

Buffer for lineString not consistent width #815

Closed

Description

@stephanbogner

I recently had the need to outline a lineString and it seems that using 'buffer' is not doing it as I expected.
I expected it to be like a stroke, so width is everywhere the same, which it clearly isn't:
bildschirmfoto 2017-06-22 um 17 13 32

You can see here my implementation vs. buffer.

→ So my question is if that is intended behaviour and if so for what reason?

Activity

  1. rowanwins commented on Jul 4, 2017

    @rowanwins
    Member

    Thanks @stephanbogner for highlighting the issue, it does indeed look like something is a bit off...

    Currently the buffer functionality is provided by the jsts library so we have limited control over that. However it's been a longstanding task/dream to remove that dependency. This is another helpful reason to keep us pursue that so thank you :)

  2. stephanbogner commented on Jul 5, 2017

    @stephanbogner
    Author

    Thank you very much for explaining this dependency – I was not aware.

  3. DenisCarriere commented on Jul 5, 2017

    @DenisCarriere
    Contributor

    The main issue with buffer was applying a buffer which is equidistant (ref issue #660).

    Before it use to do this:
    image

    To fix this, we applied a project & reproject to the coordinates (decimal degrees).

    https://github.com/Turfjs/turf/blob/master/packages/turf-buffer/index.js#L105-L110

    There's definitely room for improvement in the @turf/buffer.

  4. added a commit that references this issue on Sep 11, 2017
  5. stebogit commented on Sep 12, 2017

    @stebogit
    Collaborator

    Fixed with #938

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions