You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have identified an issue related to the VariableBuffer class from the NetTopologySuite library. When one of the widths in the array provided to the Buffer method is set to 0, it results in an unexpected error. The error message is as follows: NetTopologySuite.Geometries.TopologyException: 'side location conflict: arg 1 [ (2216873.0320880944, 5312576.81797011) ]'
Steps to Reproduce
To reproduce the issue, we have prepared a code snippet that demonstrates the problem:
The following code is working fine:
using NetTopologySuite.Geometries;
using NetTopologySuite.Operation.Buffer;
namespace tryNetTopo
{
internal class Program
{
static void Main(string[] args)
{
var polylineCoordinates = new Coordinate[]
{
new Coordinate(2216883.9690149571, 5312555.8022460323),
new Coordinate(2216880.7776965303, 5312561.9943400519),
new Coordinate(2216874.5057125678, 5312574.1638290221),
new Coordinate(2216873.0320880935, 5312576.8179701111),
new Coordinate(2216872.0585015123, 5312578.3818236338),
new Coordinate(2216871.4142499096, 5312579.3486044565)
};
double[] arr = new double[polylineCoordinates.Length];
for (int i = 0; i < arr.Length; i++)
{
arr[i] = 1;
}
arr[3] = 0;
var line = new LineString(polylineCoordinates);
var result = VariableBuffer.Buffer(line, arr);
}
}
}
The following code contains one extra coordinate, and the error will be thrown:
using NetTopologySuite.Geometries;
using NetTopologySuite.Operation.Buffer;
namespace tryNetTopo
{
internal class Program
{
static void Main(string[] args)
{
var polylineCoordinates = new Coordinate[]
{
new Coordinate(2216883.9690149571, 5312555.8022460323),
new Coordinate(2216880.7776965303, 5312561.9943400519),
new Coordinate(2216874.5057125678, 5312574.1638290221),
new Coordinate(2216873.0320880935, 5312576.8179701111),
new Coordinate(2216872.0585015123, 5312578.3818236338),
new Coordinate(2216871.4142499096, 5312579.3486044565),
new Coordinate(2216863.677298767 , 5312590.6634067535), // adding this coordinate will cause the error
};
double[] arr = new double[polylineCoordinates.Length];
for (int i = 0; i < arr.Length; i++)
{
arr[i] = 1;
}
arr[3] = 0;
var line = new LineString(polylineCoordinates);
var result = VariableBuffer.Buffer(line, arr);
}
}
}
System Configuration
NetTopologySuite version: v4.0.30319
Environment (Operating system, version and so on): Windows 11 version 21H2, 64 bits
.NET Framework version: .NET Framework 4.8
The text was updated successfully, but these errors were encountered:
Description
We have identified an issue related to the VariableBuffer class from the NetTopologySuite library. When one of the widths in the array provided to the Buffer method is set to 0, it results in an unexpected error. The error message is as follows:
NetTopologySuite.Geometries.TopologyException: 'side location conflict: arg 1 [ (2216873.0320880944, 5312576.81797011) ]'
Steps to Reproduce
To reproduce the issue, we have prepared a code snippet that demonstrates the problem:
The following code is working fine:
The following code contains one extra coordinate, and the error will be thrown:
System Configuration
The text was updated successfully, but these errors were encountered: