0

Using MSVS C#, I'm creating a KML file. For the sake of simplicity, assume that it has 2 Point placemarks with name tags A and B, respectively. The third placemark is a LineString using the coordinates from the points, with a name tag "A > B". I want the description of this placemark to say "Distance: xxx km", where xxx is the distance between A and B.

Is there a KML or Google Earth tag that I can write to the KML file that will output the distance when the file is loaded into Google Earth and I click on the line? Better yet, can I keep track of these as the app generates the KML file or in the KML file itself so that the document can have a description that has the total distance of all LineStrings?

Thanks.

user638473
  • 35
  • 6

1 Answers1

1

After posting this, I came across a Vicenty formula written in Java that does what I want. It was a simple matter to port it to C#.

It can be found at https://www.neovasolutions.com/2019/10/04/haversine-vs-vincenty-which-is-the-best/

It's a shame a forum designed to help developers would have someone downgrade a question without even bothering to post a response that might be of use, even if it's a link to where such a question was answered. If this was an admin who did this, kindly delete my account—I certainly don't need the bigotry and scrutiny. In the future, I'll try to find my answers elwewhere.

user638473
  • 35
  • 6