gps.log.out
Class GPSKMLFile

java.lang.Object
  extended by gps.log.out.GPSFile
      extended by gps.log.out.GPSKMLFile
All Implemented Interfaces:
GPSFileConverterInterface, GPSFileConfInterface, GPSFileInterface
Direct Known Subclasses:
GPSKMZFile

public class GPSKMLFile
extends GPSFile

Class to write a KML file.

Author:
Mario De Weerd, Herbert Geus (Waypoint code&Track code)

Field Summary
static java.lang.String ABSOLUTE_HEIGHT
          Values for GPSConversionParameters.KML_TRACK_ALTITUDE_STRING.
static java.lang.String CLAMPED_HEIGHT
           
static java.lang.String RELATIVE_HEIGHT
           
 
Fields inherited from class gps.log.out.GPSFile
FILE_SPLIT_NONE, FILE_SPLIT_ONE_FILE_PER_DAY, FILE_SPLIT_ONE_FILE_PER_TRACK
 
Constructor Summary
GPSKMLFile()
           
 
Method Summary
 void finaliseFile()
          Method called when all parsing is finished and the last file has to be closed.
 void initialiseFile(BT747Path basename, java.lang.String ext, int oneFilePerDay)
          This function has to be called at some time to initialize the file conversion.
 boolean nextPass()
          Called when the input file has been parsed.
 void setTrackName(java.lang.String extra_ext)
          Added to be able to set the track name in case the createFile method is overridden.
 void writeFileHeader(java.lang.String name)
          This method is to be extended as needed and is called when the file header must be written.
 void writeRecord(GPSRecord r)
          Called for any new position.
 
Methods inherited from class gps.log.out.GPSFile
addLogRecord, cachedRecordIsNeeded, getBadTrackColor, getErrorInfo, getFilesCreated, getGoodTrackColor, getMaxDiff, getNbrFilesCreated, getParamObject, getUserWayPointList, isAddLogConditionInfo, isOverridePreviousTag, isRecordNbrInLogs, needPassToFindFieldsActivatedInLog, setActiveFileFields, setAddLogConditionInfo, setBadTrackColor, setFilenameBuilder, setFilters, setGoodTrackColor, setImperial, setIncludeTrkComment, setIncludeTrkName, setMaxDiff, setOutputFields, setOverridePreviousTag, setParamObject, setRecordNbrInLogs, setTimeOffset, setTrackSepTime, setUserWayPointList, setWayPointTimeCorrection, writeLogFmtHeader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABSOLUTE_HEIGHT

public static final java.lang.String ABSOLUTE_HEIGHT
Values for GPSConversionParameters.KML_TRACK_ALTITUDE_STRING.

See Also:
Constant Field Values

RELATIVE_HEIGHT

public static final java.lang.String RELATIVE_HEIGHT
See Also:
Constant Field Values

CLAMPED_HEIGHT

public static final java.lang.String CLAMPED_HEIGHT
See Also:
Constant Field Values
Constructor Detail

GPSKMLFile

public GPSKMLFile()
Method Detail

initialiseFile

public void initialiseFile(BT747Path basename,
                           java.lang.String ext,
                           int oneFilePerDay)
Description copied from class: GPSFile
This function has to be called at some time to initialize the file conversion. Other parameters can be set through other methods.

Specified by:
initialiseFile in interface GPSFileConfInterface
Overrides:
initialiseFile in class GPSFile
Parameters:
basename - Base name of the output file. This value will be provided to the filename builder.
ext - Extension of the output file. This value will be provided to the filename builder.
oneFilePerDay - Indicates how the file must be separated.
See Also:
AppSettings.SPLIT_ONE_FILE, AppSettings.SPLIT_ONE_FILE_PER_DAY, AppSettings.SPLIT_ONE_FILE_PER_TRACK

nextPass

public final boolean nextPass()
Description copied from class: GPSFile
Called when the input file has been parsed. This method checks if other passes are needed and performs some closing operations if that is not the case.
This method must be extended, call super.nextPass() and then update nbrOfPassesToGo.

Specified by:
nextPass in interface GPSFileConverterInterface
Overrides:
nextPass in class GPSFile
Returns:
true if analysis must go on.

writeFileHeader

public final void writeFileHeader(java.lang.String name)
Description copied from class: GPSFile
This method is to be extended as needed and is called when the file header must be written. This method is called only once for each output file.

Parameters:
name - Identifier for the output file that can be used in the header.

writeRecord

public final void writeRecord(GPSRecord r)
Description copied from class: GPSFile
Called for any new position. This method is called by the input analysis class and should be extended for the output format. The extension must call super(). That will make sure that the appropriate files are opened, and the GPSFile.t property set.

Overrides:
writeRecord in class GPSFile
Parameters:
r - information regarding the position.

setTrackName

public void setTrackName(java.lang.String extra_ext)
Added to be able to set the track name in case the createFile method is overridden.

Parameters:
extra_ext -

finaliseFile

public void finaliseFile()
Description copied from class: GPSFile
Method called when all parsing is finished and the last file has to be closed.
This method can be extended. It closes the output file by default, so super() should be called once other handling is finished.

Specified by:
finaliseFile in interface GPSFileConverterInterface
Overrides:
finaliseFile in class GPSFile