0

I am looking for an algorithm description / pseudo code for an algorithm that can take N simple polygons and return a new set of polygons that all have been clipped such that there is no overlap in the set of polygons.

Each input polygon will have a value attribute that should be summarized such when looking at the result set, the accumulated value can be read for each new polygon.

Any hint on how to implement it would be nice. I am working in javascript and have operations like intersect,union,different from JSTS library, alternative turf from mapbox could also be used.

  • What you are describing sounds like region topology. – PolyGeo Mar 27 '16 at 0:14
  • 2
    Convert polygons to lines, split lines at intersections, build polygons. Calculate centroids as points. Query parent polygons to summarise their attributes – FelixIP Mar 27 '16 at 1:24
  • OpenJUMP as JTS based could give some inspiration for JSTS as well. Here is something about intersecting polygons sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/org/… and OpenJUMP has also "Intersect polygons" tool in Tools-Edit Geometry menu. It does not sum attributes for intersecting areas but leaves then null, though. – user30184 Mar 27 '16 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.