Message Boards Message Boards

0
|
4036 Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Finding elevation using latitude and longitude?

Dear all,

I have the latitude and longitude for my data. I do not have any data on altitude. I could find the elevations with GoogleMap, but I am interested in using Mathematica for my purpose.

lat = {15.295`, 15.95`, 18.79`, 18.92`, 18.65`, 19.85`, 10.66`, 
   10.89`, 10.79`, 10.75`, 10.5`, 10.59`, 16.33`, 16.48`, 14.09`, 
   14.44`, 14.16`, 13.97`, 14.6`, 13.94`, 14.03`, 14.53`, 16.43`, 
   17.33`, 16.85`, 14.84`, 16.94`, 14.87`, 14.58`, 14.5`, 14.44`, 
   14.41`, 14.94`, 14.47`, 8.73`, 8.43`, 8.77`, 7.61`, 17.003`, 
   12.91`, 13.17`, 12.81`, 12.73`, 13.05`, 12.87`, 13.004`, 12.74`, 
   16.08`, 17.22`, 16.79`, 12.11`, 12.24`, 11.94`, 11.94`, 13.54`, 
   13.43`, 17.82`, 7.51`, 14.5`, 6.63`, 6.67`, 6.93`, 6.93`, 17.43`, 
   16.76`, 7.31`, 17.42`, 15.35`, 17.74`, 17.41`, 15.87`, 10.33`, 
   9.45`, 9.1`, 8.57`, 8.54`, 8.36`, 8.43`, 7.`, 6.8`, 18.57`, 7.18`, 
   6.92`, 6.65`, 6.52`, 6.42`, 18.17`, 18.78`, 18.87`, 19.11`, 19.41`,
    17.62`, 17.87`, 17.45`, 19.3`, 17.38`, 17.15`, 17.12`, 17.41`, 
   17.44`, 16.88`, 18.17`, 16.66`, 17.24`, 16.02`, 16.79`, 16.43`, 
   19.96`, 19.87`, 19.13`, 14.3`, 15.27`, 13.39`, 14.06`, 13.98`, 
   14.97`, 14.64`, 14.72`, 14.88`, 14.74`, 14.01`, 13.73`, 13.71`, 
   13.67`, 13.16`, 12.92`, 13.08`, 18.79`, 12.1`, 12.63`, 11.77`, 
   10.5`};



lon = {103.297`, 101.45`, 99.02`, 99.33`, 98.69`, 99.81`, 99.17`, 
   99.05`, 98.94`, 99.21`, 98.96`, 99.14`, 99.27`, 99.52`, 99.18`, 
   98.8`, 99.42`, 99.63`, 99.46`, 99.41`, 99.21`, 98.79`, 102.87`, 
   99.46`, 101.94`, 101.07`, 104.72`, 101.57`, 101.45`, 101.69`, 
   101.67`, 101.68`, 102.001`, 101.59`, 99.75`, 99.78`, 98.39`, 
   100.07`, 101.36`, 99.64`, 99.68`, 99.6`, 99.64`, 99.71`, 99.54`, 
   99.59`, 99.79`, 100.4`, 100.35`, 100.2`, 99.74`, 99.44`, 99.6`, 
   99.82`, 99.36`, 99.41`, 103.39`, 100.06`, 104.06`, 100.4`, 100.32`,
    100.54`, 100.44`, 99.79`, 98.75`, 99.85`, 102.6`, 99.54`, 100.54`,
    100.13`, 104.62`, 99.1`, 100.05`, 99.63`, 99.26`, 99.96`, 100.`, 
   99.51`, 100.5`, 100.39`, 99.03`, 100.61`, 100.43`, 100.08`, 
   101.28`, 101.82`, 100.17`, 100.78`, 100.75`, 100.8`, 100.88`, 
   100.1`, 102.73`, 101.73`, 97.97`, 102.8`, 104.13`, 104.06`, 
   104.78`, 104.77`, 99.14`, 99.93`, 98.55`, 99.002`, 98.86`, 100.28`,
    101.15`, 99.88`, 99.78`, 99.9`, 99.86`, 101.19`, 100.6`, 101.37`, 
   101.71`, 102.08`, 101.33`, 102.17`, 103.5`, 98.64`, 99.97`, 
   10056.`, 100.57`, 100.61`, 100.81`, 100.87`, 100.87`, 98.98`, 
   100.06`, 101.34`, 102.88`, 99.19`};

cityCoords = Transpose[{lat, lon}];
POSTED BY: M.A. Ghorbani
5 Replies
Posted 3 years ago

Hi Hans,

Very odd. When I tried it I got the same error as Mohammad. I restarted the kernel and now it works fine. Your method is much more efficient than using Map.

I am running 12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020).

POSTED BY: Rohit Namjoshi
Posted 3 years ago

You can use GeoElevationData

cityCoords // GeoPosition // GeoElevationData // QuantityMagnitude
POSTED BY: Hans Milton

Thank you, Hans.

I got this. where am I wrong!

enter image description here

POSTED BY: M.A. Ghorbani
Posted 3 years ago

Hi Mohammad,

This works

cityCoords // Map[GeoElevationData]
POSTED BY: Rohit Namjoshi
Posted 3 years ago

Rohit, I am curious: Does "my" method work for you? It works for me. Using Windows10 and Mathematica12.2.

cityCoords // GeoPosition // GeoElevationData // QuantityMagnitude
POSTED BY: Hans Milton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract