How to obtain the accurate elevation (altitude) value using C#?

1.2k Views Asked by At

The question is - how to get elevation by point coordinates with sufficient accuracy?

Now I am using Google Maps Elevation API:

         string LatLngURL = "http://maps.googleapis.com/maps/api/elevation/xml?locations=" 
                + LatTmp.ToString(CultureInfo.GetCultureInfo("en-US"))
                    + "," + LngTmp.ToString(CultureInfo.GetCultureInfo("en-US"));
                AltNow.Text = LatLngURL; 
                XmlDocument altitudegoogle = new XmlDocument();
                altitudegoogle.Load(LatLngURL);
                XmlElement root = altitudegoogle.DocumentElement;
                XmlNode Alt = root.SelectSingleNode("/ElevationResponse/result/elevation");
                string Altitude = Alt.ChildNodes[0].InnerText;

But the thing is:

  1. That code quite slow
  2. The result is not accurate enough

Also I know that there's GeographicLib which enables to get a geoid height. But geoid height is just a difference between ellipsoid and geoid height not its absolute value.

So, there's two questions:

  1. What is the fastest and more accurate way to get altitude of the point on the map by its coordinates? (If Google Elevation API is, so how to improve my code?)

  2. Is it possible to get it using GeographicLib? Maybe I can not understand because English is not my native and everything is clear in its documentation.

0

There are 0 best solutions below