Differential or intersection of islands of 2D polygons in different layers
In CGAL, there is the Arrangement package that allows to build a topologically valid planar partition given a set of segments, and the Regularized Boolean Set-Operations that provides boolean operations between polygons.