Interestingly I had a company that manufacturers and installs solar panels contact me regarding the ASCE ground snow load map. They were wondering if there was a way so that their website could send an http request to the map with a latitude and longitude and have it kick back the snow load. Since the map is already in digital format you would not think this would be hard to do. So I got thinking about how I could build a program that given a certain lat and long would automatically click on the map and then fire back the elevation, snow load, etc...
The only problem is google maps implementation of the KML layer does not allow this transmittal of information. So I basically banged my head against the wall for almost 2 weeks trying to do the impossible. However, I was not ready to throw in the towel just yet. Since the KML data is just plain text, (coordinates) I thought there must be some way to analyze this data and determine if a given location is within a certain polygon and if it is then be able to assign that polygon description (ASCE snow load details) to a variable which is then delivered to the client. Turns out this is called the point in the polygon problem and it is well documented:
http://en.wikipedia.org/wiki/Point_in_polygon
So I was about to write an algorithm for ray casting which would have taken some time. Then I thought maybe someone else has done this before and sure enough I found a couple of good perl modules that handled this nicely and I narrowly avoided reinventing the wheel. Just a few lines of Perl later and I had managed to create a nice little API for the ASCE ground snow load data:
http://design.medeek.com/resources/medeekapi.html