[Omaha.pm] Geo::Distance (Was: DBH statement isn't closing)

Mike Hostetler hostetlerm at gmail.com
Thu Sep 21 06:52:51 PDT 2006


> No sweat. What are you using SQLite for? Just curious.

Something you may be interested in. :)

The Geo::Distance module has a method called "closest" in which you
can give it a DBI handle, a latitude, longtude, and a distance and
return the points in the database that are within that distance.  This
is very cool stuff -- I was doing it with shell scripts, gpsbabel, and
a huge XML file.  Doing it with Perl not only makes it easier, it
makes it faster, too.  Check out the details:

http://search.cpan.org/~bluefeet/Geo-Distance-0.11/Distance.pm#closest

The error I was getting wasn't from the Geo::Distance call, but from a
script I wrote that looks up a waypoint name in my SQLite database,
gets it's lat and lon, and then runs Distance->closest.

Why SQLite?  It's portable, fast, and easy to setup.

-- 

Mike Hostetler
http://mike.hostetlerhome.com/


More information about the Omaha-pm mailing list