Keep ele when removing duplicates on concat
This commit is contained in:
parent
cafb87cc6e
commit
c3db03d1e3
1 changed files with 9 additions and 2 deletions
|
|
@ -284,8 +284,15 @@ BR.Export._concatTotalTrack = function (segments) {
|
|||
|
||||
let featureCoordinates = feature.geometry.coordinates;
|
||||
if (segmentIndex > 0) {
|
||||
// remove first segment coordinate, same as previous last
|
||||
featureCoordinates = featureCoordinates.slice(1);
|
||||
// remove duplicate coordinate: first segment coordinate same as previous last,
|
||||
// remove the one without ele value (e.g. beeline)
|
||||
const prevLast = coordinates[coordinates.length - 1];
|
||||
const first = featureCoordinates[0];
|
||||
if (prevLast.length < first.length) {
|
||||
coordinates.pop();
|
||||
} else {
|
||||
featureCoordinates = featureCoordinates.slice(1);
|
||||
}
|
||||
}
|
||||
coordinates = coordinates.concat(featureCoordinates);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue