File Exchange

image thumbnail

getElevations(latit​ude, longitude, varargin)

version 1.1.0.0 (3.12 KB) by Jaroslaw Tuszynski
getElevations function queries Google Maps API webservice for ground elevations

24 Downloads

Updated 14 Dec 2017

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

getElevations function queries Google Maps API webservice for ground elevations. See https://developers.google.com/maps/documentation/elevation/ for details.

Comments and Ratings (9)

Juliana

Thomas Moser

Some times i have the message "Google Maps API requestor has exceeded quota" & sometimes i haven't ... Someon can help me ? I read the quotas of free account Google API but i think i respect this.

OK, the error is just a matter of the API response. Simple fix (AA is lat and lon):

e = nan(size(AA,1),1);
while(sum(isnan(e))>0)
disp(num2str(sum(isnan(e))))
for i = 1:size(AA,1)
if isnan(e(i,:))==0
continue
end
try
e(i,:) = get_Elevations(AA(i,1),AA(i,2));
catch
e(i,:) = nan;
end
end
end

Using the example I get:

Error using getElevations (line 79)
Google Maps API requestor has exceeded quota

Will Campbell

Chad Greene

This is fantastic. Easy to use, good error checking, and worked right out of the box. I ran into a query limit when I tried an array of 4800 points, but 480 points retrieved results in under a second. Grids work too. NaNs throw a urlread error, which is not intuitive to debug--perhaps a NaN check would help.

Updates

1.1.0.0

correct misspellings and update email

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

Inspired: pinxau1000/Matlab-Google-Elevation-API

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor