Tag Archives: KML

Python Program to Convert GPS Log file into a KML File for Display on Google Earth

In this video lesson we show you how you can transfer data from your Raspberry Pi Pico W GPS Project to your PC for display on Google Earth. This program transfers the Pi Pico GPS Log file to your PC, and as the transfer is done, the program converts the log.txt file into a .kml file for display on Google Earth.

 

Create a KML File to Display your GPS Data on Google Earth

Below we show you an example KML file that allows you too display your logged GPS data on Google Earth. For simplicity, we have included two GPS points. First, notice that the ordered pairs are Longitude,Latitude. Notice this is reversed of what we would normally expect, but it is important to note the order . . . Longitude must be put as the first term in the ordered pair. Also notice that the ordered pair of data show up two times in the file. The first is to create the dot, or placemark on the map, and the second list creates the line over your logged path. Now, the challenge for you is to write a python program that takes your log.txt file, which contains simple comma delimited data, lat,lon, and use that to generate a .kml file as shown below.