Skip to content
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

Union failed and throws "SweepEvent comparison failed" error #53

Closed
jcarbou opened this issue Dec 17, 2018 · 2 comments
Closed

Union failed and throws "SweepEvent comparison failed" error #53

jcarbou opened this issue Dec 17, 2018 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@jcarbou
Copy link

jcarbou commented Dec 17, 2018

First, thank you for you lib !

I generated a polygon using bbox clip on OSM Land polygon (http://openstreetmapdata.com/data/land-polygons). I try to generate a polygonClipping.union using the MultiPolygon generated. Error throws

Error: SweepEvent comparison failed at [-15.188987939241656, 11]... equal but not identical?

I simplified the polygons to reproduce the bug:

// The problem comes from this polygon
const p1 = [[[-15.17583125361432, 11], [-15.182247200000006, 10.996678799999998], [-15.186977083599459, 11], [-15.188987939241656, 11], [-15.210785900000019, 10.987789800000002], [-15.25473119999998, 10.999922499999997], [-15.25484460019419, 11], [-15.17583125361432, 11]]];

// p2 : any polygon intersecting p1 or not
const p2 = [[[-15.017809399999976, 10.944376500000018], [-15.012765219284972, 10.95029830701516], [-15.013805400000024, 10.942978100000005], [-15.017809399999976, 10.944376500000018]]];

polygonClipping.union(p1,p2);

The problem comes from this strange polygon (2 areas linked by a line !!!)

view

@mfogel mfogel added the bug Something isn't working label Dec 18, 2018
@rowanwins
Copy link
Contributor

Resolved by this commit

@mfogel mfogel added this to the v0.10 milestone Jan 7, 2019
@mfogel
Copy link
Owner

mfogel commented Jan 7, 2019

Thanks @jcarbou for bug report and @rowanwins for testing this with the latest on master.

Verified resolved, fix will be included in the next release to NPM.

To others who encounter this error behavior but with a different set of input coordinates - please open a new issue rather than re-open this one.

@mfogel mfogel closed this as completed Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants