Follow Me On...

Ascii Delimited Data to Thematic KML Utility


I was recently working on a project where i was using a tool that took signal strength measurements and recorded where the measurement was taking using the attached GPS receiver.  In order to display this data in a meaningful way i tried all sorts of various approaches.  In the end, i realized i could a) use expensive tools like MapInfo which could create a thematic map but doesn’t include GIS Map files which forced me to track down GIS files for each area i wanted and stitch them together!  b) purchase a program like MS MapPoint which is typically bundled with maps…

Both options would be expensive and at the end of the day the generated maps still wouldn’t look as good as the stunning maps you can create in Google Maps or Nasa WorldWind.

So, to avoid all the hassles and expense I wrote a simple command line utility which parses thematic map data from an ascii data file and creates a KML file which allows you to view your thematic map data directly in Google Maps or Nasa Worldwind. 

The result looks like this: 


Screenshot 1










Utility Details

The utility is run from the command line which accepts a number of different arguments to format the data for your application. 

All that has to be done to modify the utility for your application is tell the utility the following details (Note: these are just the required arguments):

  1. Latitude Column - indicates which column in your data is the latitude for the point data.
  2. Longitude Column - indicates which column in your data is the longitude for the data point.
  3. Latitude & Longitude Multiplier - depending on how your data is logged you might need to multiply each data point by some number to get it to the standard decimal decimal format used in KML.  For my application i had to mulitply by 0.000001.  But, most applications this should probably just be 1.
  4. Data of Interest Column - which column is the data you want to map thematically.  At the moment the utilty only supports data that can be represented by a number (it’s converted to a double in the software implementation).
  5. The ranges to which the data points are mapped to a particular icon.  In my application low values are mapped to a red icon and higher values are mapped to a green icon.
  6. Finally, the file or directory in which the ascii delimited is located.  If a directory is chosen, then every file in the directory is parsed.

There are some other options which can be specified and a few filtering options. 

Click here to download the command line reference which explains each option which can be specified at the command line.  The same information is also displayed when you try to execute either “tokml” without any arguments. 


I am considering making a GUI for the utility but i wanted to get some feedback on the level of interest and for those that are interested what is there experience with programming languages.  It may be preferrable for them to just modify my code or control it via the command line.



I’m open to suggestions about other parameters which would make the utility usable in more applications. 



Version 2

I updated the code and added a number of features for reading in files from GPS receivers.  Also, included in this release are 4 complete examples of what the utility can do.  For more information on that see the readme file inside the zip.

In an attempt to get the code to compile with GCJ, i removed some of the features which made java 1.5 neccessary.  Now the code should run with JVM’s as old as 1.2.



Initial Source Release

I uploaded the first version of the utility.  At the moment there is no GUI or command line support.  To use it modify the file.  None of the other files should need to be modified. 

Download the files from here:

Then, to run the utility from the command line type:

javac && java ReadInAnEntireDirectoryDemo

If you’re new to java - download the eclipse ide.

Note: jdk1.5 is neccessary for compiling the utility and jre1.5 is neccessary to execute.