Api to get current location including altitude?

If you are using a watch without altitude sensor then it is not normally possible to know your altitude. But if you are running a gpx course, then the gpx file should have enough information in it to know your altitude from the current latitude and longitude position. Is there an api to access this information?

  • Which watch?  Is it one with a baro altimeter?

  • If you are using a watch without altitude sensor then it is not normally possible to know your altitude.

    Actually, CIQ apps can get elevation from GPS, although watches without a baro altimeter ("altitude sensor") will hide this from the user (there won't be any native fields for elevation, total ascent, etc.), as the uncorrected data isn't very good. That's why both Garmin Connect and Strava will correct GPS elevation data after you sync your activity.

    ActivityInfo.altitude: elevation from the more accurate of GPS or baro

    PositionInfo.altitude: elevation from GPS

    SensorInfo.altitude: elevation from the more accurate of GPS or baro

    (I think ActivityInfo.altitude is all you really need for a data field)

    Having said all of that, I don't think there's a way to get elevation data from the current course.

    Perhaps the best you could do would be to write your own web service to provide course elevation data to your app. (Of course this would be a bit clunky.)

  • What I was thinking is that if you have loaded a gpx file into your watch, and you are following a route in the gpx file. Then the gpx file contains all the information you need. For each waypoint in the gpx file it has the associated elevation. So if you know your location you can look up the location in the gpx file to find the elevation. I was hoping I would be able to access the gpx file from the garmin api. But I cannot see any ways of accessing the contents of the current route.

  • You can't directly access the file directly, and the only way it can be used is with a native app.  You can they see some info in a CIQ data field.  You'll also see the current location if GPS is enabled, and the actual current elevation the watch sees,