courselog.gpsutils
Class ExporterToKML

java.lang.Object
  extended by courselog.gpsutils.ExporterToKML

public class ExporterToKML
extends java.lang.Object

Object to export a track into a KML format. The object is associated to the TrackRecord or Vector of TrackRecords object to write. The exporter also colors the output track according to a flag value which can address altitude, time or speed.


Field Summary
static byte[][] clMapBlue
          color Map, values for Blue
static byte[][] clMapGreen
          color Map, values for Green
static byte[][] clMapRed
          color Map, values for red
static byte[] clTransparent
          color Map, value for transparency
static int DF_ALTITUDE
          Identifier of altitude data flag (==1)
static int DF_SPEED
          Identifier of speed data flag (==3)
static int DF_TIME
          Identifier of time data flag (==2)
protected  double myMaxVal
          Maximum value for mapped value
protected  double myMinVal
          Minimum value for mapped value
protected  TrackRecord myTr
          Track record to convert to KML.
protected  ewe.util.Vector myVect
          Vector of records to convert to KML tracks.
static byte[] sXCBold
          close Bold
static byte[] sXCDoc
          close Document
static byte[] sXCFolder
          close Folder
static byte[] sXCKMLHead
          End of KML
static byte[] sXCLine
          close LineString
static byte[] sXCName
          close Name
static byte[] sXCPlace
          close Placemark
static byte[] sXCPoint
          close Point
static byte[] sXCStyle
          close Style
static byte[] sXIPoint
          Intermediate of Point
static byte[] sXSBold
          Header of Bold
static byte[] sXSDoc
          Header of Document
static byte[] sXSFolder
          Header of Folder
static byte[] sXSHead
          Header of XML
static byte[] sXSKMLHead
          Header of KML
static byte[] sXSLine
          Header of LineString
static byte[] sXSName
          Header of Name
static byte[] sXSPlace
          Header of Placemark
static byte[] sXSPoint
          Header of Point
static byte[] sXSStyle
          Header of Style
static byte[] sXTOpen
          Tag for open
static byte[] sXTVisibility
          Tag for visibility
 
Constructor Summary
ExporterToKML(TrackRecord track)
          Creates a new instance of ExporterToKML.
ExporterToKML(ewe.util.Vector vect)
          Creates a new instance of ExporterToKML.
 
Method Summary
 int colorIndexOf(double val)
           
 void exportToFile(ewe.io.File fOut, int dataFlag)
          Export track(s) to a file.
 int formatAltitude(byte[] buf, double val)
           
 int formatDuration(byte[] buf, double val)
           
 int formatIdxPoint(byte[] buf, int idx)
           
 int formatLatOrLon(byte[] buf, double val)
           
 int formatSpeed(byte[] buf, double val)
           
 void scanMinMaxLegendValues(int dataFlag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DF_ALTITUDE

public static final int DF_ALTITUDE
Identifier of altitude data flag (==1)

See Also:
Constant Field Values

DF_TIME

public static final int DF_TIME
Identifier of time data flag (==2)

See Also:
Constant Field Values

DF_SPEED

public static final int DF_SPEED
Identifier of speed data flag (==3)

See Also:
Constant Field Values

sXSHead

public static final byte[] sXSHead
Header of XML


sXSKMLHead

public static final byte[] sXSKMLHead
Header of KML


sXCKMLHead

public static final byte[] sXCKMLHead
End of KML


sXSDoc

public static final byte[] sXSDoc
Header of Document


sXCDoc

public static final byte[] sXCDoc
close Document


sXTVisibility

public static final byte[] sXTVisibility
Tag for visibility


sXTOpen

public static final byte[] sXTOpen
Tag for open


sXSFolder

public static final byte[] sXSFolder
Header of Folder


sXCFolder

public static final byte[] sXCFolder
close Folder


sXSPlace

public static final byte[] sXSPlace
Header of Placemark


sXCPlace

public static final byte[] sXCPlace
close Placemark


sXSName

public static final byte[] sXSName
Header of Name


sXCName

public static final byte[] sXCName
close Name


sXSBold

public static final byte[] sXSBold
Header of Bold


sXCBold

public static final byte[] sXCBold
close Bold


sXSPoint

public static final byte[] sXSPoint
Header of Point


sXIPoint

public static final byte[] sXIPoint
Intermediate of Point


sXCPoint

public static final byte[] sXCPoint
close Point


sXSLine

public static final byte[] sXSLine
Header of LineString


sXCLine

public static final byte[] sXCLine
close LineString


sXSStyle

public static final byte[] sXSStyle
Header of Style


sXCStyle

public static final byte[] sXCStyle
close Style


clMapRed

public static final byte[][] clMapRed
color Map, values for red


clMapGreen

public static final byte[][] clMapGreen
color Map, values for Green


clMapBlue

public static final byte[][] clMapBlue
color Map, values for Blue


clTransparent

public static final byte[] clTransparent
color Map, value for transparency


myTr

protected TrackRecord myTr
Track record to convert to KML.


myVect

protected ewe.util.Vector myVect
Vector of records to convert to KML tracks.


myMinVal

protected double myMinVal
Minimum value for mapped value


myMaxVal

protected double myMaxVal
Maximum value for mapped value

Constructor Detail

ExporterToKML

public ExporterToKML(TrackRecord track)
Creates a new instance of ExporterToKML. Initialises with a single track.

Parameters:
track - Track to convert.

ExporterToKML

public ExporterToKML(ewe.util.Vector vect)
Creates a new instance of ExporterToKML. Initialise with a vector of TrackRecord elements.

Parameters:
vect - Tracks to convert.
Method Detail

exportToFile

public void exportToFile(ewe.io.File fOut,
                         int dataFlag)
Export track(s) to a file.

Parameters:
fOut - File to write to.
dataFlag - Identification of data to associate.

scanMinMaxLegendValues

public void scanMinMaxLegendValues(int dataFlag)

colorIndexOf

public int colorIndexOf(double val)

formatAltitude

public int formatAltitude(byte[] buf,
                          double val)

formatDuration

public int formatDuration(byte[] buf,
                          double val)

formatSpeed

public int formatSpeed(byte[] buf,
                       double val)

formatLatOrLon

public int formatLatOrLon(byte[] buf,
                          double val)

formatIdxPoint

public int formatIdxPoint(byte[] buf,
                          int idx)