-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: turf/difference fails on a shared edge #1393
Milestone
Comments
Additional note, there is a larger bug in |
linking the issue here w8r/martinez#81 |
Happens to me as well, here even shorter code: const difference = require('@turf/difference')
let result = turf.difference(
{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[16.2,48.0],[16.6,48.0],[16.6,48.1],[16.2,48.1],[16.2,48.0]]]}},
{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[16.4,48.0],[16.6,48.0],[16.6,48.1],[16.4,48.1],[16.4,48.0]]]}}
)
console.log(JSON.stringify(result)) |
Resolved in v6.2.0 onwards |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears difference is failing due to a bug in a supporting library: w8r/martinez#35
Here is a runnable test that exhibits the behavior
This failure happens since
martinez
returns a malformed polygon when two edges overlap. It returns a "good" difference and as well as a two- or three-point polygon. Could this be detected and handled prior to handing off tohelper.polygon
, which is where the exception occurs?(Hoping creating a tracking issue between the two libraries helps find a common solution faster.)
The text was updated successfully, but these errors were encountered: