Removing Complexities

My colleague Alyssa Wright just asked me an interesting question: Vancouver Island is a pretty crinkley island, how would we simplify it to remove the crinkley bits?

Original Island

Notice the big fjords and other fine work by Slartibartfast. ST_Simplify will not do what we need, since it removes redundant vertices within a tolerance. So the fjords will have fewer vertices, but they'll still be there.

However, it turns out there is a solution, and I didn't even need a long walk in the snow to figure it out. If we buffer by a large amount, then reverse the buffer by the same amount, we'll get something that has a similar shape to the original, but without the crinkly bits.

Buffered by 4km

Buffer out, and the crinkley bits get melted away. But now the island is too big. So buffer inwards.

Negative Buffer by 4km

And now we have something we can use. We could now even run ST_Simplify on this result to drop some unneeded vertices and make it smaller yet.

Simple Island

Looking closer, you can see how we have melted away all the crinkley bits while still following the original (mostly). Note that the new shape is still a strict superset of the original.

Saanich Peninsula

EmailTwitterFacebookGoogle+tumblrLinkedIn

5 thoughts on “Removing Complexities

  1. Very nice creative solution. I would have needed that long walk in the snow to figure that one out, but now that I've read about it it'll go straight into my toolbox for future use. Thanks!

  2. Pingback: Tweets that mention OpenGeo – Removing Complexities -- Topsy.com

  3. This is equivalent to the "closing" operation from mathematical morphology (dilation followed by erosion) - cf. http://en.wikipedia.org/wiki/Closing_(morphology)

    The mathematical morphological operators are in general extremely powerful tools for preprocessing/simplification of complex imagery as part of a geospatial feature extraction pipeline.

Comments are closed.