com.c5corp.c5gps.filters
Class CsvTrackLogListFilter

java.lang.Object
  extended by com.c5corp.c5gps.filters.CsvTrackLogListFilter
All Implemented Interfaces:
GpsDataFilter

public class CsvTrackLogListFilter
extends java.lang.Object
implements GpsDataFilter

The CsvTrackLogListFilter functions both as an input and output filter to read and write standard GPS tracklog .csv files. Importantly, this filter really does filter any data input from a track log file. It is a little bit fascist, in fact, forcibly:

  1. converting any vertical units to those configured for the installed C5UTM database (C5 Landscape database) for both input, processing, and output (only dealing with feet and meters)
  2. Rounding the easting, northing and elevation data to integers.
  3. Rejecting any data if it does not match the configured datum for the installed database
  4. Uses the zoneOffset data in the track log to convert all time into UTC (GMT).

The data is massaged in this maner because this class is intended to support i/o for a C5 Landscape Database (C5UTM) installation, thus units and datum are validated. For example, all altitude data from the file will automatically converted to the vertial elevation units configured in the database application. (See com.c5corp.c5utm.C5UTMconfs for more info). The readFile() method of this class will abort on datum mismatches.

Since:
2.0
Author:
Brett Stalbaum Copyright 2002-2006 see LICENSE.txt and UCSD_LICENSE.txt
See Also:
C5UTMconfs

Constructor Summary
CsvTrackLogListFilter(java.io.File file)
          Constructor creates a CsvTrackLogFilter .
 
Method Summary
 TrackLogList readFile()
          Reads in a GPS track log file in standard .csv format
 void setFile(java.io.File file)
          Sets the file for this filter to filter
 java.lang.String toString(GpsDataFileType dataOb)
          implements toString(GpsDataFileType dataOb), returning a String representation of the data object filtered by this type.
 void writeFile(GpsDataFileType dataOb)
          Writes a GPS TrackLogList in standard .csv format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvTrackLogListFilter

public CsvTrackLogListFilter(java.io.File file)
Constructor creates a CsvTrackLogFilter . The file should point to a text .csv tracklog file of the type exported from the gps2win utility.

Parameters:
file - a File representing the Track Log .csv to read
Method Detail

setFile

public void setFile(java.io.File file)
Sets the file for this filter to filter

Specified by:
setFile in interface GpsDataFilter
Parameters:
file - the output file to which data should be sent
See Also:
GpsDataFilter.writeFile(GpsDataFileType)

readFile

public TrackLogList readFile()
Reads in a GPS track log file in standard .csv format

Specified by:
readFile in interface GpsDataFilter
Returns:
a GpsDataFileType representing the data read from the file

writeFile

public void writeFile(GpsDataFileType dataOb)
Writes a GPS TrackLogList in standard .csv format.

Specified by:
writeFile in interface GpsDataFilter
Parameters:
dataOb - the object containing the data to write to the file
See Also:
GpsDataFilter.setFile(File)

toString

public java.lang.String toString(GpsDataFileType dataOb)
implements toString(GpsDataFileType dataOb), returning a String representation of the data object filtered by this type.

Specified by:
toString in interface GpsDataFilter
Parameters:
dataOb - the dataOb to Stringify
Returns:
a String representation of the data in dataOb