Write Recorded Path To KML

@whiterose

Here is the KML writer for the Recorded path.

In the SaveOpen.Designer.cs about line 1815 just before //flags ******** insert all of this:

//Recorded Path
            kml.WriteStartElement("Folder");
            kml.WriteElementString("name", "Recorded Path");
            kml.WriteElementString("visibility", "1");

            //for (int i = 0; i < recPath.recList.Count; i++)
            //{
                linePts = "";
                kml.WriteStartElement("Placemark");
                kml.WriteElementString("visibility", "1");

                kml.WriteElementString("name", "Path " + 1);
                kml.WriteStartElement("Style");

                kml.WriteStartElement("LineStyle");
                kml.WriteElementString("color", "ff6509ff");
                kml.WriteElementString("width", "2");
                kml.WriteEndElement(); // <LineStyle>
                kml.WriteEndElement(); //Style

                kml.WriteStartElement("LineString");
                kml.WriteElementString("tessellate", "1");
                kml.WriteStartElement("coordinates");

                for (int j = 0; j < recPath.recList.Count; j++)
                {
                    linePts += pn.GetLocalToWSG84_KML(recPath.recList[j].easting, recPath.recList[j].northing);
                }
                kml.WriteRaw(linePts);

                kml.WriteEndElement(); // <coordinates>
                kml.WriteEndElement(); // <LineString>

                kml.WriteEndElement(); // <Placemark>
            //}
            kml.WriteEndElement(); // <Folder>   

That should do it. The red wiggly line is what I recorded and saved.

image

And using my graphics to curve importer, this is it running with the left edge on the recorded path line, via a curve picked from the KML file of the recorded path. Doing the U-turn, it looses the path in that tight corner. Because it jumps from one curve to the next one when it can’t make the turn.

image

3 Likes

It will be very useful for me, thank you very much, Regards.

Do you have it for version 5?
i installed the code for version 4 but it doesn’t work.
do you have for version 4?

Let me see what will work in the latest. 5.4.1. I’ve not been in it yet.