Converting KML to PNG for faster overlay loading?

1,449 views
Skip to first unread message

Robin Bijlani

unread,
Sep 6, 2011, 11:45:19 AM9/6/11
to google-map...@googlegroups.com
I am making a map to display climate data. This data comes to me in .KML files, but they contain many tiny polygons covering the United States, so the file takes a long time to load as a KmlLayer, and I need the map to be more responsive.

I have tried using Fusion Tables, but the data only shows up correctly when zoomed in further than I would like to be.

It seems the easiest option would be to use .PNGs and custom overlays. But how can I convert the .KML files to .PNGs? I have Googled and searched the Google KML group but just can't seem to find the right tool. The .KML files are originally made in ArcGIS and the person that provides them to me can't seem to figure out how to generate images.

Any ideas are greatly appreciated.

Jeremy Geerdes

unread,
Sep 6, 2011, 12:01:30 PM9/6/11
to google-map...@googlegroups.com
The biggest task is figuring out how to convert between the geographical coordinates (i.e., Lat/Lng pairs) and pixel and tile coordinates. Once you get that, you can run the kml through a little script and automatically build your tiles with ease. The tile numbering scheme has changed since v2, but the concepts are all similar to what I outlined in the GMaps API v2 group at the link below:

http://groups.google.com/group/google-maps-api/browse_thread/thread/c630b2ecb8cd761c/e318e5cdf58c212c?lnk=gst&q=author%3Ajgeerdes+lat+lng+pixel#e318e5cdf58c212c

Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

For more information or a project quote:

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/sO-JM0QTBwcJ.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Robin Bijlani

unread,
Sep 7, 2011, 9:27:49 AM9/7/11
to google-map...@googlegroups.com
I was intending to do a simple image overlay just pointing to an image path and listing the NE and SW bounds, like seen here: http://code.google.com/apis/maps/documentation/javascript/examples/overlay-hideshow.html

Is the purpose of building specific tiles just for better image definition when zoomed in? That's not especially important for this project. I'm just having a tough time generating the .PNGs from the .KMLs in the first place.
Reply all
Reply to author
Forward
0 new messages