Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
José Rosa edited this page May 16, 2018 · 3 revisions

Matlab-Google-Elevation-API wiki

Welcome to the Matlab-Google-Elevation-API wiki!

Getting Started

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.

Get a Google Elevations API Key

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.

How to get a Google Elevations API Key?
  1. Go to https://console.developers.google.com and Login with you Google Account;
  2. Create a new project or select an existing one;
  3. Go to Google Elevation API and activate this API to your current project;
  4. Go to credentials and create a new API Key or use one of the existing ones if you have already created some valid keys.

Function getElevationsPath.m

[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).

Function Parameters

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.
Function Output
Number of Output Variables Output Data Unit
One Elevation Meters (m)
Two Resolution Meters (m)
Three Longitude Degrees (º)
Four Latitude Degrees (º)

Downloads

Important links