NAME
    Geo::Gosmore - Interface to the headless gosmore(1) routing application

SYNOPSIS
    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.

        my $gosmore = Geo::Gosmore->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;

DESCRIPTION
    Provides an interface to the headless version of the gosmore
    <http://wiki.openstreetmap.org/wiki/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.

ATTRIBUTES
  gosmore_method
    Either "binary" or "http". If binary "gosmore_path" is a path to a
    gosmore.pak and we'll invoke gosmore(1) from your $PATH.

    If it's "http" "gosmore_path" is a URL to an online gosmore router.

  gosmore_path
    Either a path to a gosmore.pak (see "gosmore_method") or a HTTP URL to a
    gosmore CGI routing script without query parameters.

METHODS
  route
    Find a route based on the attributes you've passed in. Takes a
    Geo::Gosmore::Query object with your query, returns a
    Geo::Gosmore::Route object.

LICENSE AND COPYRIGHT
    Copyright 2011 Ævar Arnfjörð Bjarmason <avar@cpan.org>

    This program is free software, you can redistribute it and/or modify it
    under the same terms as Perl itself.

