Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging intersecting polygons to single polygon

Question :

I want to remove overlaps from existing polygons with javascript.

I guess merging overlapping polygons to single polygon is the easiest way to do this but i don't know how to do this.

I want to combine theese polygons This is the resault i want to achive

like image 505
Utku Cansever Avatar asked Oct 28 '25 09:10

Utku Cansever


1 Answers

You need to implement Vatti's algorithm or use some polygon library which realizes it (or other reliable algo).

Clipper library uses this algorithm, but seems it has not JavaScript binding yet.

Javascript port exists for GPC (sometimes less robust)

like image 168
MBo Avatar answered Oct 30 '25 23:10

MBo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!