How to simplify (reduce number of points) in KML?

Herb Caudill picture Herb Caudill · Oct 10, 2008 · Viewed 9.1k times · Source

I have a similar problem to this post. I need to display up to 1000 polygons on an embedded Google map. The polygons are in a SQL database, and I can render each one as a single KML file on the fly using a custom HttpHandler (in ASP.NET), like this http://alpha.foresttransparency.org/concession.1.kml .

Even on my (very fast) development machine, it takes a while to load up even a couple dozen shapes. So two questions, really:

  1. What would be a good strategy for rendering these as markers instead of overlays once I'm beyond a certain zoom level?

  2. Is there a publicly available algorithm for simplifying a polygon (reducing the number of points) so that I'm not showing more points than make sense at a certain zoom level?

Answer

PiedPiper picture PiedPiper · Oct 10, 2008

For your second question: you need the Douglas-Peucker Generalization Algorithm