mapbox / mapbox/geosimplify-js

gapTolerance does not work

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33
Forks
4
PR merge metrics
No merged PRs in 30d

Description

It doesn't appear any value of `gapTolerance` changes the output of `geosimplify`.

The `getDist` function which is used to handle the `gapTolerance` behavior, doesn't return a value (i.e., it returns `void`) which probably contributes to the issue.
https://github.com/mapbox/geosimplify-js/blob/62ea7cba764a98be22467b5f23f360f214259ed6/geosimplify.js#L23-L25

The following tests (and more) could be added to check the `gapTolerance` argument.

```javascript
result = geosimplify(equator_latitude_5m_offset, 5.0, 1);
t.equal(result.length, 3, 'Removed no coordinates');
```

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 in geosimplify.js at the linked getDist function around lines 23–25 and trace how gapTolerance affects geosimplify output. Add or update tests covering the supplied gapTolerance example and verify that the expected number of coordinates is returned when the tolerance changes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.