views:

71

answers:

1

I have a bunch of GPX files on our server and would like to overlay them on top of a Google Map to display them on our website. We use Perl for all our site scripts however we're having a hard time figuring out how to format the data correctly to display it in Google Maps.

I'm hoping that some GPX expert out there can explain at a high level how we can best accomplish this and provide some sample perl code to correctly process the GPX file and print out the necessary HTML to display it on a Google Map.

Thanks in advance for your help!!!

+1  A: 

The tool you really want to use is GPSBabel. If you want a somewhat perlish interface to it, rather than just driving it from the commandline, there's also a GPS::Babel module.

hobbs
Thanks for the quick response Hobbs! Once I read the GPX file in using GPSBabel, how do I then output it in the correct format for being displayed on a Google map. Have you seen a good example somewhere?
Russell C.
You tell gpsbabel to convert from gpx to kml.
hobbs
Ok, so you now have a KML file. So how do you then overlay that on Google Maps?
Russell C.
@hobbs - Any idea how to overlay a KML file on a Google Map?
Russell C.
http://code.google.com/apis/maps/documentation/javascript/overlays.html#KMLLayers
hobbs