add precision parameter to intersect to pass into polyclip-ts?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
I am facing the 'unable to complete output ring' from intersect that was discussed in #2048 - I am using 0.7.2 so I am using the polyclip-ts version of Turf, which was the preferred fix in 2048.
I think my issue is related to floating point accuracy - I get this error from polyclip:
Error: Unable to complete output ring starting at [-89.33422366666666666667, 43.09035333333333333333]. Last matching segment found ends at [-89.334221, 43.09036].
There's an issue in polyclip-ts - https://github.com/luizbarboza/polyclip-ts/issues/5 that suggests changing the precision that polyclip-ts uses - there's a call available in polyclip for polyclip.setPrecision()
If I replicate the turfjs intersect code but add a setPrecision call to something very high I no longer see the error and I get the expected result.
Would it be possible to add a parameter to turf-intersect for precision that it can pass along to polyclip?
(Happy to pass along the problematic polygons if that would help)
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 at the turf-intersect entry point and compare its polyclip-ts usage with the setPrecision call described in the issue. Review polyclip-ts issue #5 and the prior discussion in #2048, then determine how a precision parameter should be forwarded. Done means intersect accepts the parameter and the reported polygons complete without the output-ring error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100