Tips for using and editing KML files from GPS Essentials

65 views
Skip to first unread message

tempg...@gmail.com

unread,
May 17, 2021, 5:11:55 AM5/17/21
to GPS Essentials
I spent some time documenting the recent problem with bogus track lengths here:

Along the way, I decided to document some tips for editing and using KML files here:
https://jagbev.ca/_temp/gpse/tips.html

I hope you find it useful to understand what you're seeing in Google Earth while viewing KML files.

jag

m-ba...@orange.fr

unread,
May 18, 2021, 4:47:42 AM5/18/21
to gpsess...@googlegroups.com

Thanks jag,

for this precise description.

It happens that I do exactly the same modifications to my kml files. So I second your proposal for improvement.

As far as changing the wrong coordinates in the file, what you do is a very good option.

I sometimes have to delete extra points that are useless. I use a method that could be used to suppress 0 0 0 points :

  1. Import the file in Notepad
  2. copy the the large block of N(x,y,z) points. Take care to copy exactly form the first to the last point.
  3. paste it in  column A of a new Excel file
  4. copy the block of “times”  with same care.
  5. Paste it in column B of the same Excel file. I check that they both have the same length.
  6. Now, I can delete the lines I want without losing the logical relation between position and time of each point. I usually delete more than the erroneous point because my file is often much longer than needed for a good navigation along the path in google Earth.
  7. When I am happy with the new list, I reverse the process to copy both blocks back into Notepad at their exact place.

Hope that helps.

 

Michel

 

 

De : gpsess...@googlegroups.com <gpsess...@googlegroups.com> De la part de tempg...@gmail.com
Envoyé : lundi 17 mai 2021 11:12
À : GPS Essentials <gpsess...@googlegroups.com>
Objet : Tips for using and editing KML files from GPS Essentials

--
You received this message because you are subscribed to the Google Groups "GPS Essentials" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gpsessential...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gpsessentials/189514c3-a940-443f-89f6-d6156e4b45bbn%40googlegroups.com.

tempg...@gmail.com

unread,
May 19, 2021, 3:05:43 AM5/19/21
to GPS Essentials
Salut Michel,
Since Notepad can't search for "\r\n", I have a PHP script I use that adds "\r\n":
$text=file_get_contents("test.kml");
$text=str_replace("</", "@@@", $text);
$text=str_replace("<'", PHP_EOL."<", $text);
$text=str_replace("@@@", "</",$text);
file_put_contents("test.fixed.kml",$text);

That puts each point on a separate line and it can be imported into a spreadsheet easily.  As you said, then it's easy to delete bad points. I just do some mental arithmetic and interpolate.

Reply all
Reply to author
Forward
0 new messages