Turfjs / Turfjs/turf

`kinks` possible false positives on Yosemite polygon

Open
#2,919 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

@turf/kinks
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

This polygon geometry for Yosemite has a hole in it at (-119.84323,37.83471) where it overlaps with Stanislaus National Forest. The polygon is otherwise valid, but the inner ring causes kinks to return four self-intersections due to the corner at (-119.84566, 37.83285). But the inner ring is a self-tangency, not a self-intersection, so it seems like there should be no kinks.

Whether self-tangency makes a polygon "invalid" is apparently a point of contention; relevant spec links:

  • OGC: "Rings may not touch other rings, except at a point." (as in this case)
  • Mapbox: "Linear rings MUST be geometric objects that have no anomalous geometric points, such as self-intersection or self-tangency."

yosemite-national-park.json

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 at the kinks implementation and reproduce the report with yosemite-national-park.json, focusing on the inner ring near the supplied coordinates. Read the linked OGC and Mapbox validity guidance before deciding how self-tangency should be classified. Done means the Yosemite geometry no longer produces false self-intersections, with behavior consistent with the chosen specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.