Skip to content

turf-destination strips altitude/elevation member from origin coordinate. #2850

@prozvora

Description

@prozvora

The destination function does not return all members of the origin parameter.

https://github.com/Turfjs/turf/blob/master/packages/turf-destination/index.ts#L40

Note the return value creates a Position array with [lng, lat], but the origin parameter may have a third element, which should be carried over.
https://github.com/Turfjs/turf/blob/master/packages/turf-destination/index.ts#L70

GeoJSON specifies that a Position may have a third element, representing altitude or elevation.
https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1

This also affects turf-ellipse, which uses destination in its conversion of an ellipse to a polygon.
https://github.com/Turfjs/turf/blob/master/packages/turf-ellipse/index.ts#L151

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions