Closed WindingWinter closed 1 year ago
This is probably because the VariableBuffer code doesn't explicitly handle zero distances. It ends up creating invalid buffer lines at the point with zero distance.
This is probably an easy fix, to just check for a zero distance at a vertex and create a valid buffer around it.
(I'm actually not sure why the first case works at all - it should exhibit the same problem.)
But let's say that the correct buffer distance is indeed 0 for that particular segment of line?
On Wed, Aug 9, 2023 at 12:57 PM Martin Davis @.***> wrote:
This is probably because the VariableBuffer code doesn't explicitly handle zero distances. It ends up creating invalid buffer lines at the point with zero distance.
This is probably an easy fix, to just check for a zero distance at a vertex and create a valid buffer around it.
(I'm actually not sure why the first case works at all - it should exhibit the same problem.)
— Reply to this email directly, view it on GitHub https://github.com/locationtech/jts/issues/995#issuecomment-1670655548, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADENIZS4S453MHAFAWZWDULXUMKC5ANCNFSM6AAAAAA3HYLL5Y . You are receiving this because you authored the thread.Message ID: @.***>
I think it's better if JTS can just handle buffer distance=0. To me there is an easy way to do it.
Break the polyline internally at buffer distance =0, and subject the individual polyline to the existing algorithm, problem solved.
Does VariableBuffer support 0 buffer distance at one of the vertex? Here's what I found from NetTopologySuite library, and I suspect that the same issue is presented on the JTS library also.
The code is in NTS, but it's trivial to convert it to Java.
The code below is working fine, even though it has a 0 buffer distance
BUT, the following code doesn't work, even though it just contains an extra coordinate, which shouldn't matter?