GraphHopperClient - the Ruby gem for the GraphHopper Directions API
You use the GraphHopper Directions API to add route planning, navigation and route optimization to your software. E.g. the Routing API has turn instructions and elevation data and the Route Optimization API solves your logistic problems and supports various constraints like time window and capacity restrictions. Also it is possible to get all distances between all locations with our fast Matrix API.
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 0.11-SNAPSHOT
- Build package: io.swagger.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build directions-api-client.gemspec
Then either install the gem locally:
gem install ./directions-api-client-0.11-SNAPSHOT.gem
(for development, run gem install --dev ./directions-api-client-0.11-SNAPSHOT.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'directions-api-client', '~> 0.11-SNAPSHOT'
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'directions-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'directions-api-client'
api_instance = GraphHopperClient::GeocodingApi.new
key = "key_example" # String | Get your key at graphhopper.com
opts = {
q: "q_example", # String | If you do forward geocoding, then this would be a textual description of the address you are looking for
locale: "locale_example", # String | Display the search results for the specified locale. Currently French (fr), English (en), German (de) and Italian (it) are supported. If the locale wasn't found the default (en) is used.
limit: 56, # Integer | Specify the maximum number of returned results
reverse: true, # BOOLEAN | Set to true to do a reverse Geocoding request, see point parameter
point: "point_example", # String | The location bias in the format 'latitude,longitude' e.g. point=45.93272,11.58803
provider: "provider_example" # String | Can be either, default, nominatim, opencagedata
}
begin
#Execute a Geocoding request
result = api_instance.geocode_get(key, opts)
p result
rescue GraphHopperClient::ApiError => e
puts "Exception when calling GeocodingApi->geocode_get: #{e}"
end
All URIs are relative to https://graphhopper.com/api/1
Class | Method | HTTP request | Description |
---|---|---|---|
GraphHopperClient::GeocodingApi | geocode_get | GET /geocode | Execute a Geocoding request |
GraphHopperClient::IsochroneApi | isochrone_get | GET /isochrone | Isochrone Request |
GraphHopperClient::MatrixApi | matrix_get | GET /matrix | Matrix API |
GraphHopperClient::MatrixApi | matrix_post | POST /matrix | Matrix API Post |
GraphHopperClient::RoutingApi | route_get | GET /route | Routing Request |
GraphHopperClient::SolutionApi | get_solution | GET /vrp/solution/{jobId} | Return the solution associated to the jobId |
GraphHopperClient::VrpApi | post_vrp | POST /vrp/optimize | Solves vehicle routing problems |
- GraphHopperClient::Activity
- GraphHopperClient::Address
- GraphHopperClient::Configuration
- GraphHopperClient::CostMatrix
- GraphHopperClient::CostMatrixData
- GraphHopperClient::CostMatrixDataInfo
- GraphHopperClient::Detail
- GraphHopperClient::GHError
- GraphHopperClient::GHErrorHints
- GraphHopperClient::GeocodingLocation
- GraphHopperClient::GeocodingPoint
- GraphHopperClient::GeocodingResponse
- GraphHopperClient::IsochroneResponse
- GraphHopperClient::IsochroneResponsePolygon
- GraphHopperClient::IsochroneResponsePolygonGeometry
- GraphHopperClient::IsochroneResponsePolygonProperties
- GraphHopperClient::JobId
- GraphHopperClient::Location
- GraphHopperClient::MatrixRequest
- GraphHopperClient::MatrixResponse
- GraphHopperClient::ModelBreak
- GraphHopperClient::Objective
- GraphHopperClient::Relation
- GraphHopperClient::Request
- GraphHopperClient::Response
- GraphHopperClient::ResponseCoordinates
- GraphHopperClient::ResponseCoordinatesArray
- GraphHopperClient::ResponseInfo
- GraphHopperClient::ResponseInstruction
- GraphHopperClient::ResponseInstructions
- GraphHopperClient::Route
- GraphHopperClient::RoutePoint
- GraphHopperClient::RouteResponse
- GraphHopperClient::RouteResponsePath
- GraphHopperClient::Routing
- GraphHopperClient::Service
- GraphHopperClient::Shipment
- GraphHopperClient::Solution
- GraphHopperClient::SolutionUnassigned
- GraphHopperClient::Stop
- GraphHopperClient::TimeWindow
- GraphHopperClient::Vehicle
- GraphHopperClient::VehicleType
- Type: API key
- API key parameter name: key
- Location: URL query string