0

Starting with some polygons I want to calculate the resulting polygon based on the union of them. I need this to, having some coutries, make a region of them together in only one polygon.

I need this without external dependencies because I need to run on jruby, which do not support external C dependencies.

Douglas Lise
  • 1,466
  • 1
  • 20
  • 46

1 Answers1

1

Well, you can detect if a polygon's point lies within next polygon and remove this point, thus you will have an array of points that define union of two polygons. Procedure is recursive, algorithm for finding inner points is described here: http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/

Also read this question: How do I combine complex polygons?

Community
  • 1
  • 1
Anton
  • 3,006
  • 3
  • 26
  • 37