+ Reply to Thread
Results 1 to 4 of 4

google elevation api

  1. #1
    Registered User
    Join Date
    01-03-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    8

    google elevation api

    I'm trying to get elevation data in Excel.
    I have a map with a path and I want an elevation graph below (something like this example, but no need for the "animation" stuff)

    I have a table of lat and lon coordinates from which to build the elevation graph.
    I found the code below that I want to use to get the elevation for each of those coordinates.
    However I can not get the code to work. Can someone get the code to work for me ?

    see attached file for example

    source: http://oco-carbon.com/2012/10/02/alt...elevation-api/
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: google elevation api

    In the VBA editor, click Tools - References. In the list, tick the box for Microsoft XML, v6.0 and click OK to close the References dialogue. Then your UDF formula should work.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    01-03-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: google elevation api

    Thanks,

    I got it working. I know that it is also possible to call multiple samples between 2 points

    example
    It would be nice if I could use this. That would eliminate a huge chunk of excel data. I now have the start and endpoint of a set of path. I then calculate intermediate coordinates in excel and use the function from the previous post to call the elevation for each of those points.

    How would I go about changing the function I got now, into a function/macro that can use the path as input, and give a column of elevations ?
    (input start and end lat & lon + a sample# then output a column with an elevation for each sample?)

    *edit added clarification
    Last edited by freegame; 11-26-2012 at 05:59 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: google elevation api

    Try the following function which returns a 2-dimensional array of elevations (latitude, longitude and elevation) for each sample on the path between a start and endpoint. The function can be used as a worksheet array formula (entered using Ctrl+Shift+Enter) and called from VBA. Further details are contained in the code.
    Please Login or Register  to view this content.
    Here is example code showing its use with VBA:
    Please Login or Register  to view this content.
    Last edited by Chippy; 11-27-2012 at 08:08 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1