KML Generator

Overview

The KML Generator takes as an input a CSV file (with a header line) and generates a kml file that can be visualized in Google Earth to visualize the results of an experiment. Only one variable at a time can be currently plotted. However, Google Earth is capable of loading (and displaying) multiple kml files (and switching them on and off with a simple mouse click).

Location

The AERPAW KML generator is located in /root/Profiles/PostProcessing/akmlGen.py

Running the KML Generator

usage: python3 akmlGen.py [-h] --target TARGET [--output [OUTPUT]]

                  [--colormap COLORMAP] [--linewidth LINEWIDTH] [--smooth SMOOTH]

                  csvFile


Generates a KML file from a CSV file given a target field.


positional arguments:

  csvFile               CSV Log File


optional arguments:

  -h, --help               show this help message and exit

  --target    TARGET       target field to plot from the CSV file

  --output    [OUTPUT]     kml output file - default is same as target string

  --colormap  COLORMAP     colormap to use - default is jet

  --linewidth LINEWIDTH    linewidth for the kml file - default is 10

  --smooth    SMOOTH       it adds gradient on the color between data points

The KML generator will generate a kml file with segments between the coordinates of two consecutive lines in the CSV file. Each coordinate is specified by Latitude, Longitude, Altitude (these exact names for the Latitude, Longitude, and Altitude need to be used on the header line). The Altitude is specified in meters and is relative to the underlying terrain. The value of the corresponding target field is shown using the specified colormap. The target field is mandatory and can be any of the fields present in the CSV file.

The colormap can be any colormap supported by matplotlib. The default colormap (if none is specified) is "jet". Note that all named colormaps can be reversed by appending "_r" to their name (e.g., jet_r). 

To visualize the kml file, start Google Earth and open the kml file (Menu -> File -> Open, or Ctrl+o).


Note: Please use quotes ("") for arguments that includes special characters such as (, ], etc.