Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

API Keys For Navigation and Elevation

Iwan Novirion edited this page Sep 17, 2016 · 17 revisions

Navigation

Overview

The navigation system has a priority queue that it goes through to find the next best navigation strategy. If a strategy fails, it will be blacklisted for the next hour.

The navigation strategies we support now are:

  1. Google - Requires a key, limit of 2500 requests per day per IP address, human-like pathing
  2. Mapzen - Requires a key, no API limits, human-like pathing
  3. YOURS - No key required, human-like pathing
  4. Gpx - Walk between gpx waypoints, in a straight line.
  5. Default - Walk between waypoints, in a straight line.
  6. Teleport - Teleport between waypoints.

Fallback Strategy:

Google -> Mapzen -> Yours -> Default

Note: Gpx and Teleport do not have fallback strategies.

Elevation

Overview

The elevation system has a priority queue that it goes through to find the next best elevation service. If a service fails, it will be blacklisted for the next hour.

The elevation services we support now are:

  1. Mapzen - Requires a key, no API limits. This is a different key than Mapzen Turn by Turn key.
  2. MapQuest - No key required, no API limits
  3. Google - Requires a key, limit of 2500 requests per day per IP address. This can be the same key as the Google Directions API key for navigation, but you need to enable Elevation API in Google API Console.
  4. Default - Random elevation value

Fallback Strategy

Mapzen -> MapQuest -> Google -> Default

Note: Mapzen is prioritized because it has no API limits and is fast and reliable. MapQuest requires no key, but is known to return less reliable elevation values. Google has limits per day so it is third in priority.

Getting API Keys

Google APIs

First, get your Google API keys at:
https://developers.google.com/maps/documentation/directions/get-api-key?authuser=3

Then copy it to your config.json file

Second, enable the services at:
https://console.developers.google.com/apis

Enable key for both Google Maps Directions API and Google Maps Elevation API.

Remember!
You can use the same key for both services, but you need to enable for both first.
google-apis

Mapzen

Get your Mapzen keys at:
https://mapzen.com/developers/

Get separate keys for Turn by Turn and Elevation mapzen-apis

Example Configuration for Walking Strategy

Pick one strategy that suits to you:

"GoogleWalkConfig": {
  "UseGoogleWalk": true,
  "DefaultStepLength": 1.3,
  "GoogleHeuristic": "walking",
  "GoogleAPIKey": "your-key-here",
  "Cache": true,
  "GoogleElevationAPIKey": "your-key-here"
},
"YoursWalkConfig": {
  "UseYoursWalk": true,
  "YoursWalkHeuristic": "bicycle"
},
"MapzenWalkConfig": {
  "UseMapzenWalk": true,
  "MapzenTurnByTurnApiKey": "your-key-here",
  "MapzenWalkHeuristic": "bicycle",
  "MapzenElevationApiKey": "your-key-here"
},