You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
var union = turf.union(turf.featureCollection([poly1, poly2, poly3, ...]))
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.
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: