Download elevations from Google Maps (API key required)
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].
----------------------------------------------------------------------------------------------------------------------------
BE AWARE:
From July 2018, Google allows a 200$ bonus to request the elevations and other data, check on:
https://developers.google.com/maps/documentation/elevation/usage-and-billing
200$ allows a big number of requests for free! But you better check here for costs and details:
https://developers.google.com/maps/documentation/elevation/usage-and-billing
https://cloud.google.com/maps-platform/pricing/#billing
----------------------------------------------------------------------------------------------------------------------------
To run this function, you need the following libraries:
1) Wouter Falkena (2019). xml2struct (https://www.mathworks.com/matlabcentral/fileexchange/28518-xml2struct), MATLAB Central File Exchange. Retrieved December 18, 2019.
2) scott lee davis (2019). Google Earth Toolbox (https://www.mathworks.com/matlabcentral/fileexchange/12954-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) (https://www.mathworks.com/matlabcentral/fileexchange/73722-download-elevations-from-google-maps-api-key-required), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > Scientific Data >
- MATLAB > External Language Interfaces > Other languages > Google >
- Sciences > Geoscience > Geodesy and Mapping >
- Engineering > Civil and Environmental Engineering > Earthquake Engineering >
Tags
Acknowledgements
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!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.