locationtech/jts

VariableBuffer to handle zero distances

Closed this issue · 1 comments

Description

I've incorporated the patch Fix VariableBuffer to handle zero distances. However, there still exists an instance where the error is thrown, specifically when both the start and end widths are set to 0.

The error message is as follows:
NetTopologySuite.Geometries.TopologyException: 'side location conflict: arg 0 [ (199.99999999999977, 99.999999999999972) ]'

Steps to Reproduce

Here's the .Net code to reproduce the issue:

using NetTopologySuite.Geometries;
using NetTopologySuite.Operation.Buffer;

namespace tryNetTopo
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var polylineCoordinates = new Coordinate[]
              {
                    new Coordinate(0, 100),
                    new Coordinate(100.49, 93),
                    new Coordinate(200, 100),
              };

            double[] arr = new double[] {0, 3.6, 0};
            
            var line = new LineString(polylineCoordinates);
            var result = VariableBuffer.Buffer(line, arr);
        }
    }
}

The three points forms a simple line as follow:
image

dr-jts commented

Unable to reproduce using latest VariableBuffer code.