turf
turf copied to clipboard
booleanValid does not validate exteriors with only '1' point intersect
Please provide the following when reporting an issue:
- v6.5.0
- multipolygon-touch.geojson
- Snippet of source code or for complex examples use jsfiddle. The function is supposed to "... check if the geometry is a valid according to the OGC Simple Feature Specification." according to L10, turfJS/b-valid and the standard states "2. The Boundaries of any 2 Polygons that are elements of a MultiPolygon may not ‘cross’ and may touch at only a finite number of points. (Note that crossing is prevented by assertion 1 above). ∀ M ∈ MultiPolygon, ∀ Pi, Pj ∈ M.Geometries(), ∀ ci ∈ Pi.Boundaries(), cj ∈ Pj.Boundaries() ci ∩ cj = {p1, ….., pk | pi ∈ Point, 1 <= i <= k}" and multipolygon-touch.geojson touches apparently only in one point ('finite number of points), I conclude that we need to change the code to let this case pass.
I am using/developing the dart port of the packages. Do you also get a test failure in this case? I believe you should as https://github.com/Turfjs/turf/blob/2dd2ef88c44d847989fa0b82089f3f81fe433b83/packages/turf-boolean-valid/index.ts#L117 returns false even if there is only 1 intersecting point. (which is finite I believe)
Att: @lukas-h
Please run the JS unit tests locally to validate @armantorkzaban