« USPS Zip Code Polygons Updated | Main | New Application: Display a single USPS Zip Code Boundary »

Google Polygon Encoding Algorithm in Perl

We've created a Google Polygon Encoding Algorithm in Perl released under GPL. This routine was ported from Mark McClure's work located at: http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/

There is a slight difference to our routine, the choices as to which points to drop at certain zooms was made using the Douglas-Peucker routine instead of the distance method employed by the original routine. This allows the polygon to maintain its shape better at the lower zooms plus allows specifying the tolerance in meters instead of radians. The performance of our routine is less due to the additional math from the Haversine formula embedded in our D-P, but this is offset by the easier to understand code that was produced.

We are open to suggestions on how this routine can be improved, so please send any suggestions our way.

USNaviguide_Google_Encode.pm - A Perl module

About

This page contains a single entry from the blog posted on October 8, 2007 10:11 AM.

The previous post in this blog was USPS Zip Code Polygons Updated.

The next post in this blog is New Application: Display a single USPS Zip Code Boundary.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.31