LineSplit is a great feature but it doesn't work as expected. I use a simple Polygon (triangle) as a splitter to split a simple four-point LineString. This should result in three LineStrings but only two are produced:
var line = {
type: "Feature",
geometry: {
type: "LineString",
coordinates: [[13.8716,56.2783],[13.8715,56.2785],[13.8743,56.2794],[13.8796,56.2746]]
}
};
var splitter = {
type: "Feature",
geometry: {
type: "Polygon",
coordinates: [[[13.8726,56.2786],[13.8716,56.2786],[13.8713,56.2784],[13.8726,56.2786]]]
}
};
var split = turf.lineSplit(line, splitter);
Returns this collection:
{
type: "FeatureCollection",
features: [{
type: "Feature",
geometry: {
type: "LineString",
coordinates: [[13.8716, 56.2783], [13.871532142857145, 56.27843571428571]]
}
},
{
type: "Feature",
geometry: {
type: "LineString",
coordinates: [[13.871532142857145, 56.27843571428571], [13.8715, 56.2785], [13.8743, 56.2794], [13.8796, 56.2746]]
}
}]
}
Instead of this:
{
type: "FeatureCollection",
features: [{
type: "Feature",
geometry: {
type: "LineString",
coordinates: [[13.8716, 56.2783], [13.871532142857145, 56.27843571428571]]
}
},
{
type: "Feature",
geometry: {
type: "LineString",
coordinates: [[13.871532142857145, 56.27843571428571], [13.8715, 56.2785], [13.871811111111098, 56.2786]]
}
},
{
type: "Feature",
geometry: {
type: "LineString",
coordinates: [[13.871811111111098, 56.2786], [13.8743, 56.2794], [13.8796, 56.2746]]
}
}]
}
This is my first post ever on GitHub, so please be kind if I'm doing something wrong. Have searched earlier issues and haven't seen this bug report.
LineSplit is a great feature but it doesn't work as expected. I use a simple Polygon (triangle) as a splitter to split a simple four-point LineString. This should result in three LineStrings but only two are produced:
Returns this collection:
Instead of this:
This is my first post ever on GitHub, so please be kind if I'm doing something wrong. Have searched earlier issues and haven't seen this bug report.