-
Notifications
You must be signed in to change notification settings - Fork 952
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
@turf/union : ambiguity in the documentation #2657
Comments
I agree the API docs don't look quite right. That said, you can union more than 2 polygons. You can include as many polygons as you want in your featureCollection input. This is as of Turf 7.0
|
My bad, turf.union() can actually union more than 2 polygons and works like a charm. It was a mistake in my code. My apologies for the inconvenience. I am closing the issue. |
Thanks, let’s leave this open for improvement of the docs, multiple people have stumbled here since v7 release |
turf.union() can only merge 2 polygons at once (https://stackoverflow.com/questions/68005988/geojson-turf-merge-multiple-polygons-to-one-polygon-keeping-hole). It should be specified in the documentation (https://www.npmjs.com/package/@turf/union) and in the TypeScript interface file to avoid invalid merges with more than 2 polygons.
The text was updated successfully, but these errors were encountered: