turf icon indicating copy to clipboard operation
turf copied to clipboard

`kinks` possible false positives on Yosemite polygon

Open benjaminblack opened this issue 6 months ago • 1 comments

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

benjaminblack avatar Jul 15 '25 20:07 benjaminblack

Thanks for highlighting this @benjaminblack. It does sound like a false positive. Will take a look.

smallsaucepan avatar Nov 11 '25 22:11 smallsaucepan