Union of complex polygons

Posted by grenade on Stack Overflow See other posts from Stack Overflow or by grenade
Published on 2010-04-19T13:31:43Z Indexed on 2010/04/19 13:43 UTC
Read the original article Hit count: 397

Filed under:
|
|

Given two polygons:

POLYGON((1 0, 1 8, 6 4, 1 0))
POLYGON((4 1, 3 5, 4 9, 9 5, 4 1),(4 5, 5 7, 6 7, 4 4, 4 5))

How can I calculate the union (combined polygon)?

alt text

Dave's example uses SQL server to produce the union, but I need to accomplish the same in code. I'm looking for a mathematical formula or code example in any language that exposes the actual math. I am attempting to produce maps that combine countries dynamically into regions. I asked a related question here: http://stackoverflow.com/questions/2653812/grouping-geographical-shapes

© Stack Overflow or respective owner

Related posts about math

Related posts about geometry