mapbox / mapbox/geosimplify-js
gapTolerance does not work
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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