-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the Matlab-Google-Elevation-API wiki!
To use the function just download the download or the getElevationsPath.m file and move the function file (getElevationsPath.m) to your current script location.
Now in your script just call the function getElevationsPath.m and provide the correct parameters.
You need to have a Google Elevations API Key to use the function. See the topic below to know more.
This function just provide a easy way to get the elevation data provided by Google Elevations API. In order to request that elevations to Google you need to have a API Key.
- Go to https://console.developers.google.com and Login with you Google Account;
- Create a new project or select an existing one;
- Go to Google Elevation API and activate this API to your current project;
- Go to credentials and create a new API Key or use one of the existing ones if you have already created some valid keys.
[elevation, resolution, latitudes, longitudes] = getElevationsPath(latitude1, longitude1, latitude2, longitude2, samples, 'key', 'YOUR-API-KEY');
Returns SAMPLES points of elevation, resolution, latitudes and longitudes from the path from Point1(latitude1, longitude1) to Point2(latitude2, longitude2).
ALL THE PARAMETERS OF THIS FUNCTION ARE REQUIRED!
Parameter | Description | Input Range | Data Type | Unit |
---|---|---|---|---|
latitude1 | Latitude of the first coordinate | -90<lat<90 | Numeric | Degrees (º) |
longitude1 | Longitude of the first coordinate | -180<lat<180 | Numeric | Degrees (º) |
latitude2 | Latitude of the second coordinate | -90<lat<90 | Numeric | Degrees (º) |
longitude2 | Latitude of the second coordinate | -180<lat<180 | Numeric | Degrees (º) |
samples | The number of points requested between two points | 2<lat<512 | Numeric | N.A. |
key | Flag to mark that the API KEY is provided next | 'key' | String | N.A. |
API_KEY | Replace this by your API KEY between ' | 'YOUR-API-KEY' | String | N.A. |
Number of Output Variables | Output Data | Unit |
---|---|---|
One | Elevation | Meters (m) |
Two | Resolution | Meters (m) |
Three | Longitude | Degrees (º) |
Four | Latitude | Degrees (º) |