Switch from using Google Maps API for elevation to Open Elevation API (#22306)

## Description:

Switches elevation helper to use [Open Elevation](https://open-elevation.com/) instead of Google Maps API which now requires a API key. It's a drop in replacement for Google Maps too!

**Related issue (if applicable):** fixes #19860

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
pull/22317/head
Robbie Trencheny 2019-03-22 16:01:43 -07:00 committed by GitHub
parent 58c23bc2d9
commit 773c567563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -9,7 +9,7 @@ from typing import Any, Optional, Tuple, Dict
import requests
ELEVATION_URL = 'http://maps.googleapis.com/maps/api/elevation/json'
ELEVATION_URL = 'https://api.open-elevation.com/api/v1/lookup'
IP_API = 'http://ip-api.com/json'
IPAPI = 'https://ipapi.co/json/'
@ -70,7 +70,6 @@ def elevation(latitude: float, longitude: float) -> int:
ELEVATION_URL,
params={
'locations': '{},{}'.format(latitude, longitude),
'sensor': 'false',
},
timeout=10)
except requests.RequestException: