mapbox / mapbox/polyline

reading and writing coordinates doesn't return same values

Open
#38 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
674
Forks
101
PR merge metrics
No merged PRs in 30d

Description

```
$> echo '{"type":"LineString", "coordinates": [[10,52],[10.1,52.1]]}' | polyline --fromGeoJSON | polyline
[[-0.00002,52],[9.99998,52.1],[10.09998,52.09998]]
```

The rounding errors are probably by design but the coordinates are somehow corrupted.

```@mapbox/polyline@1.0.0```

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

Reproduce the reported command with @mapbox/polyline@1.0.0 and compare the decoded coordinates with the GeoJSON input. Start by tracing the CLI's GeoJSON conversion and the polyline encode/decode path; done means a GeoJSON LineString round trip preserves its coordinates within the intended precision rather than introducing the reported offset.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.