Home

What is kml?

Python Documentation

Other Links

 



Installation instructions.

Compilation.

Online manual.

 

 
 

 

3. USING Kml Toolkit

This section describes formats of various input files valid for Kml Toolkit and
the usage of output file.


3.1 Input Files


3.1.1 Event Files
These are the text files which can produce animated or static (as
specified by user) kmz files.
They contain entries of the form:

<latitude, longitude, date, burn- value>


• latitude, longitude are geographical coordinates of the place
where the event had occurred.
• date is the date (in dd-mm-yy format)when the event occured.
This helps to create labels in Earth browser as the
timeline progresses.
• Burn-value is the score generated by data-mining algorithms
which is an index of the extent of ?re at the location. This
is used to color the icons according to thresholds de?ned in
’legendmap’ dictionary in the Event2Kml.py module.
In addition to these entries, a line (to be displayed as the folder
name in places panel in Earth browser) can be added at the top.
Note : The line should start after ’#’ followed by a blank space.

Sample eventfile:
# Fires detected using yearly delta algorithm
35.032292,-119.068715,07-Mar-2003,4679.190476
35.032292,-119.071259,23-Mar-2003,4522.761905
35.030208,-119.070768,19-Feb-2003,4518.190476

One can provide multiple eventfiles. Kml Toolkit sets different icons
for different files. The image files for icons are present inside the
Resources folder.
• First file: the ’Fire’ icon (Fire.png)
• Second file: the ’Tree’ icon (Tree.png)
• Third file: the ’Flag’ icon (Flag.png)
• Fourth file: the ’Plus’ icon (Plus.png)
• Fifth file: the ’Star’ icon (Star.png)

Color of the icon is set according to the burn-value of the event.
Four different colors with rgb codes as follows are possible: ff2b,
efccc5, ee0400, 776221. Burn-value thresholds for coloring can be
defined in the ’legendmap’ dictionary in Event2Kml.py module.

3.1.2 Data Files
These are the text files which can produce static kmz files. They
contain entries of the form:

<latitude, longitude>

• latitude, longitude are geographical coordinates of the place
where the event had occurred.

In addition to these entries, a line (to be displayed as the folder
name in places panel in Earth browser) can be added as a com-
mented line at the top.
Note : The line should start after ’#’ followed by a blank space.

Sample datafile:
# Fires detected using recursive merging algorithm
35.032292,-119.142499,
35.030208,-119.139462,
35.032452,-119.149342,
35.034565,-119.137235,

One can have multiple datafiles. Kml Toolkit uses the icon datafile-
Marker.png to mark the locations. The color of the icon is set
according to the sequence in which datafiles are supplied. The
datafiles are mapped to respective colors according to the ’col-
ormap’ dictionary.


For example if the user runs the command:
*****************************************************************
python Event2Kml.py --datafile=file1.txt --datafile=file2.txt
--outputfile=Fire
*****************************************************************
Kml Toolkit will set the color of file1.txt icon as specified in col-
ormap[’1’] and color of file2.txt icon as speci?ed in colormap[’2’]
and generate the output file Fire.kmz
User can edit the dictionary in case the sequence written in it is
not the desired one. The get colorcode() function in Assets.py
module can be extended to add more colors. The modules are
well documented. Please refer to associated docstrings for fur-
ther information.


3.1.3 Polygons
These are the kml files which mark polygons on earth browsers.


3.2 Output File
Kml Toolkit generates files in kmz format which is a zipped form of kml
files. The filename is set according to the --outputfile option. In
case --outputfile option is not used by the user, Kml Toolkit sets it to the
default filename document.kmz
The output files can be rendered by earth browsers. The eventfiles
display a box titled ’Legend’ which displays information about icon -
burn value mapping. The animated eventfiles display date below the
box as the timeline progresses.
For further information on kml, refer to the following link:
http://code.google.com/apis/kml/documentation/kml tut.html

 

 
© COPYRIGHT 2009  ALL RIGHTS RESERVED BY REGENTS OF UNIVERSITY OF MINNESOTA                                                webmaster: Vasudha Mithal