Turfjs / Turfjs/turf

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

Open
#2,850 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/turf-destination/index.ts at the referenced lines and inspect how the destination position is constructed. Check packages/turf-ellipse/index.ts to understand the affected conversion. Done means destination preserves the origin's altitude or elevation member and ellipse output remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.