Download elevations from Google Maps (API key required)

Get elevations from Google Maps (Google API key required) from latitute and longitude, coordinates input (UTM)
Updated 19 Dec 2019

View License

Get elevation from Google Maps (you need an API key to use this function! Check on Google developers page).
The function create an URL to download the points elevations. Each URL corresponds to a single request. A single request can contain up to 450 points.
For example, if you want to get the elevation for 1231 points, the function will submit three requests:
- the first request returns 450 elevations;
- the second request returns 450 elevations;
- the third requests returns 331 elevations.

The function requires 2 UTM coordinates arrays and the UTM zone.
It saves: an Excel file with the elevations; a .KML file to visualize on Google Earth your points; .xml files corresponding to each request. The function outputs are:
- an array of structures including the elevations of the points and their coordinates;
- array of the elevations [m].
From July 2018, Google allows a 200$ bonus to request the elevations and other data, check on:
200$ allows a big number of requests for free! But you better check here for costs and details:
To run this function, you need the following libraries:

1) Wouter Falkena (2019). xml2struct (, MATLAB Central File Exchange. Retrieved December 18, 2019.

2) scott lee davis (2019). Google Earth Toolbox (, MATLAB Central File Exchange. Retrieved December 18, 2019.
This function was created during my collaboration with Disaster Resilience Simulation Lab (Polytechnic of Turin, Italy) and it contributed to the following achievement:
- 11th National Conference on Earthquake Engineering (Los Angeles 25-29 June 2018):
"Resilience assessment of large scale water distribution networks: a simulation approach".
- 16th European conference on Earthquake Engineering (Thessaloniki 18-21 June 2018):
"Monte Carlo Approach to Model the Progressive Failure of Water Distribution Networks:
Application to a Virtual City".

Cite As

Veronica Taurino (2024). Download elevations from Google Maps (API key required) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: xml2struct, Google Earth Toolbox, utm2deg

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

mod. description, libraries included, example input included


Mod. Description


Mod. description