Geo::Routing::Driver::Gosmore - Gosmore driver for Geo::Routing
First install gosmore(1), e.g. on Debian:
sudo aptitude install gosmore
Then build a gosmore.pak file:
wget http://download.geofabrik.de/osm/europe/british_isles.osm.bz2 # pv(1) is not needed, it just shows you the import progress bzcat british_isles.osm.bz2 | pv | gosmore rebuild
Then use this library, with gosmore_path being the full path to your new gosmore.pak.
gosmore_path
my $gosmore = Geo::Routing->new( gosmore_path => $gosmore_path, ); my $query = Geo::Gosmore::Query->new( flat => '51.5425', flon => '-0.111', tlat => '51.5614', tlon => '-0.0466', fast => 1, v => 'motorcar', ); # Returns false if we can't find a route my $route = $gosmore->route($query); my $distance = $route->distance;
Provides an interface to the headless version of the gosmore routing library. When compiled with headless support it provides a simple interface to do routing. This library just parses its simple output and provides accessors for it.
We also support accessing the headless gosmore(1) program through a remote CGI interface.
Either binary or http. If binary "gosmore_path" is a path to a gosmore.pak and we'll invoke gosmore(1) from your $PATH.
binary
http
$PATH
If it's http "gosmore_path" is a URL to an online gosmore router.
Either a path to a gosmore.pak (see "gosmore_method") or a HTTP URL to a gosmore CGI routing script without query parameters.
To install Geo::Routing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Routing
CPAN shell
perl -MCPAN -e shell install Geo::Routing
For more information on module installation, please visit the detailed CPAN module installation guide.