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:
What would be a good strategy for rendering these as markers instead of overlays once I'm beyond a certain zoom level?
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?
To reduce the size of your . kml or . shp file without degrading the quality of the data, zip the file by saving it as a KMZ or SHZ. Just open the file and click either save as KMZ or save as SHZ.
One way to extract coordinates from your KML is to upload your KML to Google's Fusion Tables. If Google Earth parses your data then most likely you'll be able to import into a Fusion Table. Short-cut to create a "Fusion Table" is simply clicking "Create a Fusion Table" from here and pick your KML file.
You can edit KML files in a notepad editor, such as Notepad++ or Sublime Text. This can allow you to rearrange folders, and change layer order. The folders use the XML tag "Folder", and items inside the folder can be "Placemarks", "Document", "GroundOverlay" and others.
For your second question: you need the Douglas-Peucker Generalization Algorithm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With