Module: Azimuth::Client::RouteMatrix

Included in:
Azimuth::Client
Defined in:
lib/azimuth/client/route_matrix.rb

Overview

Methods for the Route Matrix API

Instance Method Summary collapse

Instance Method Details

#route_matrix(locations, options = {}) ⇒ Hashie::Mash

Get calculation of the distances and driving times between locations.

Examples:

Azimuth.route_matrix(['48.843079, 2.314442', '48.869061, 2.383329']

Parameters:

  • locations (Array)

    the locations

  • options (Hash) (defaults to: {})

    optional parameters

Options Hash (options):

  • :manyToOne (Hash)

    parameter

  • :allToAll (Hash)

    parameter

Returns:

  • (Hashie::Mash)

    the locations and their distance and traveling time

See Also:



16
17
18
19
20
# File 'lib/azimuth/client/route_matrix.rb', line 16

def route_matrix(locations, options={})
  parameters = { locations: locations, options: options }

  format_response(post('routematrix', parameters))
end