When given a line with two points at different elevations, lineSliceAlong and lineChunk output new points with an arbitrary elevation of one of the endpoints.
I'd expect 2D output as was the old behavior, or if the computation is performed in 3D space, an interpolated elevation.
The change seems to be an unintended side effect of #2852.
Example:
const line = {
type: 'Feature',
geometry: {
type: 'LineString',
coordinates: [
[0, 0, 0], // start, elevation=0
[0, 0.0009, 100], // ~100m, elevation=100
],
},
};
const sliced = turf.lineSliceAlong(line, 0, 50, { units: 'meters' });
console.log('New endpoint:', sliced.geometry.coordinates[1]); // midpoint is at 100m elevation
https://jsfiddle.net/67aex0jc/