How do I combine polygons?
April 11, 2007 7:48 AM
Subscribe
Given multiple contiguous polygons, the coordinates of which are precisely known, how can I combine them into a coordinate set for a single polygon?
I'm creating some maps that show the zip codes within a US metro area, shaded by the frequency of a particular event within each zip code. I've got the cartographic boundary files from the Census Bureau, and have created some pretty nice-looking maps using Perl and GD. However, I'd like to draw custom borders around certain contiguous "clusterings" of zip codes. Can anyone describe (not necessarily in code -- even just at an abstract, theoretical level) how I might combine multiple polygons (for which I have exact coordinates) into a single polygon, the outline of which I can overlay on the map as the "cluster border?"
The only thing I've thought of would be to actually draw in a temp image each zip code as a filled polygon, and then do a pixel-by-pixel analysis of the resultant image to figure out where the border lies, but surely there's a simpler way.... isn't there?
posted by Doofus Magoo to technology (18 comments total)
4 users marked this as a favorite
posted by chunking express at 7:55 AM on April 11, 2007