booleanPointInPolygon: ignoreBoundary option is ambiguous
Open
Nobody has claimed this yet.
@turf/boolean-point-in-polygon
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
- turf version: 6.5.0
the result of the following code is false false while point (1.5,1.5) is mathematically on the boundary of the polygon.
const pt = turf.point([1.5, 1.5]);
const poly = turf.polygon([[
[0, 0],
[1, 0],
[2, 1],
[1, 1],
[0, 0],
]]);
const a = turf.booleanPointInPolygon(pt, poly, { ignoreBoundary: true });
const b = turf.booleanPointInPolygon(pt, poly, { ignoreBoundary: false });
console.log(a);
console.log(b);
I guess you mean something else by 'boundary' and perhaps you mean vertices defining the polygon. It sounds ambiguous by the way.
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 by reproducing the JavaScript snippet at the booleanPointInPolygon entry point and inspect how ignoreBoundary is interpreted for the reported polygon. Done means the boundary semantics are unambiguous and the behavior for both option values matches that definition, with coverage for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100