|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.c5corp.c5gps.GpsType
com.c5corp.c5gps.GpsPointCollection
com.c5corp.c5gps.TrackLog
public class TrackLog
The public class TrackLog class encapsulates data a tracklog file. TrackLog metadata include three fields - a track name, a version (such as "Version CSV:2" indicating that how the log was stored, and a Datum string. (Such as NAD27_CONUS).
Note that if you are loading a TrackLog from a java.io.File, you would use a descendent of the com.c5corp.c5gps.filters.GpsDataFilter class to get a reference to get an instance of this class.
Another important matter to note is that all of the C5UTM GpsDataFileType classes and the data classes they encapsulate are intended for use with a relational database application. There are fields in typical GPS data that are ignored by these classes, and often, floating point type numbers are rounded to intergers. While data read from files will often be of this type, any extracted from the database will be of the subclass type com.c5corp.c5utm.DbTrackLog.
GpsDataFilter
,
CsvTrackLogListFilter
Field Summary | |
---|---|
protected C5UTMconfs |
confs
|
protected java.util.Vector<TrackPoint> |
trackPoints
|
Fields inherited from class com.c5corp.c5gps.GpsType |
---|
hdatum |
Constructor Summary | |
---|---|
TrackLog()
Default TrackLog constuctor. |
|
TrackLog(java.lang.String trackName,
java.lang.String version,
java.lang.String datum,
int zoneOffset)
Constructor taking a name, version, datum, and zoneOffest value. |
|
TrackLog(java.util.Vector<TrackLog> trackLogs)
Creates a TrackLog from a java.util.Vector containing other TrackLog objects. |
Method Summary | |
---|---|
void |
addTrackPoint(java.lang.String type,
int zoneNum,
int easting,
int northing,
java.util.Calendar date,
int altitude)
Adds a TrackPoint to the TrackLog. |
void |
addTrackPoint(java.lang.String type,
int zoneNum,
int easting,
int northing,
int altitude)
Adds a TrackPoint to the TrackLog, with a default (epochal) date. |
void |
addTrackPoint(java.lang.String type,
int zoneNum,
int easting,
int northing,
int month,
int day,
int year,
int hour,
int minute,
int second,
int altitude)
Adds a TrackPoint to the TrackLog. |
void |
addTrackPoint(java.lang.String type,
int zoneNum,
java.lang.String zoneChar,
int easting,
int northing,
java.util.Calendar date,
int altitude)
Adds a TrackPoint to the TrackLog. |
void |
addTrackPoint(java.lang.String type,
int zoneNum,
java.lang.String zoneChar,
int easting,
int northing,
int altitude)
Adds a TrackPoint to the TrackLog, with a default (epochal) date. |
void |
addTrackPoint(java.lang.String type,
int zoneNum,
java.lang.String zoneChar,
int easting,
int northing,
int month,
int day,
int year,
int hour,
int minute,
int second,
int altitude)
Adds a TrackPoint to the TrackLog. |
int |
calculateCumulativeDistance()
Returns the cumulative distance between all points in the track Returns a sentinel value of -1 if there are no internal TrackPoints in the TrackLog. |
int |
calculateCumulativeElevationChange()
The cumulative elevation change is always a positive value, because it it is calculated via the absolute value of elevational change from between sequential points in the track. |
int |
calculateDistance()
Returns the simple straight line distance (in meters) between begin point and end point. |
int |
calculateEastingRange()
Finds the range between the minimum and maximum easting values |
int |
calculateElevationDifference()
The elevation difference between beginning point and end point. |
double |
calculateElevationEfficencyRatio()
The elevation efficiency ratio is the nominal elevation change divided by the cumulative elevation change. |
int |
calculateMaximumSlope()
Calculates the maximum slope (as a percentage) between any two adjacent points in the track. |
int |
calculateMinMaxElevationDifference()
The elevation difference between the minimum elevation and the maximum elevation. |
int |
calculateNorthingRange()
Find the range between the minimum and maximum northing values. |
int |
calculateSWcornerEasting()
Finds the southwest corner easting for the area enclosing the track log |
int |
calculateSWcornerNorthing()
Finds the southwest corner northing for the area enclosing the track log |
double |
calculateTrackStdev()
Calculates and returns the standard deviation of the elevations in the track. |
double |
calculateTrackStraightnessRatio()
The straightness ratio is the straight-line distance (begin point to end point) divided by the cumulative distance of the track. |
int |
countTrackPoints()
Returns the number of TrackPoints in the Track Log |
boolean |
equals(TrackLog trackLog)
Compares another Tracklog to this to see if they are equivalent tracks. |
java.lang.String |
getCleanTrackName()
accessor for the track name, truncates at any "|" characters and removes white space in favor of "_", giving a gps friendly name for a track |
java.lang.String |
getDatum()
accessor for the datum string |
protected double |
getDistance(TrackPoint one,
TrackPoint two)
Returns the distance between two trackpoints |
java.lang.String |
getTrackName()
accessor for the track name |
TrackPoint[] |
getTrackPoints()
returns an array of TrackPoint objects |
java.lang.String |
getVersion()
version (such as "Version 2:CSV"). |
int |
getZoneOffset()
accessor for the zone offset |
int[] |
getZones()
Returns a sorted array of integers representing the zones found in the TrackLog TrackPoint objects |
boolean |
hasMoreElements()
implements java.util.Enumeration |
boolean |
isRoundTrip()
A track log is a round trip if it starts and begins within 100 meters of the start point. |
boolean |
isSnapped()
A raw GPS tracklog is a vector. |
TrackLog |
makeCopy()
returns a TrackLog object that is a copy of this TrackLog |
TrackPoint |
nextElement()
implements java.util.Enumeration |
void |
removeDuplicateTrackPoints()
Removes duplicate TrackPoints from the TrackLog, where duplicate is defined as a sequentially duplicated point with the exact zone, easting and northing. |
void |
reset()
resets the java.util.Enumeration to the first element |
TrackLog[] |
segmentTrackLog()
Segments The TrackLog into individual segments such that the last point in each new segment is also the furthest point from the starting point of the segment. |
void |
setDatum(java.lang.String datum)
mutator for the datum string |
protected void |
setIsSnapped(boolean isSnapped)
mutator for the isSnapped value |
void |
setTimeToGmt()
Changes the internal Calendar representation for each TrackPoint in this TrackLog to GMT, and sets the zone offset for this object to 0 (GMT). |
void |
setTrackName(java.lang.String trackName)
mutator for track name |
void |
setVersion(java.lang.String version)
mutator for version string |
void |
setZoneOffset(int zoneOffset)
mutator for the zone offset from GMT |
int |
size()
returns the number of elements (TrackPoints) in this TrackLog. |
void |
snapToDatabase(java.sql.Connection connection)
Snaps TrackPoints in the input track log to their closest Points in the database. |
TrackLog |
subSegment(int from,
int to)
returns a TrackLog object representing TrackPoints element "from" to the element "to". |
java.lang.String |
toString()
Overrides toString() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<TrackPoint> trackPoints
protected C5UTMconfs confs
Constructor Detail |
---|
public TrackLog()
public TrackLog(java.util.Vector<TrackLog> trackLogs)
trackLogs
- Vector of trackLogs to concatenate into a new TrackLogpublic TrackLog(java.lang.String trackName, java.lang.String version, java.lang.String datum, int zoneOffset)
trackName
- the name of the trackversion
- the g7towin version, such as "Version CSV:2"datum
- the datumzoneOffset
- the zone offset from GMTMethod Detail |
---|
public boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration
Enumeration
public TrackPoint nextElement() throws java.util.NoSuchElementException
nextElement
in interface java.util.Enumeration
java.util.NoSuchElementException
Enumeration
public void reset()
public int getZoneOffset()
public java.lang.String getTrackName()
public java.lang.String getCleanTrackName()
public java.lang.String getVersion()
GpsDataFilter
public java.lang.String getDatum()
public boolean isSnapped()
snapToDatabase(java.sql.Connection)
protected void setIsSnapped(boolean isSnapped)
isSnapped
- true sets this TrackLog to snappedpublic void setZoneOffset(int zoneOffset)
zoneOffset
- offset from GMTpublic void setVersion(java.lang.String version)
version
- sets the g7towin version stringpublic void setTrackName(java.lang.String trackName)
trackName
- the name of the trackpublic void setDatum(java.lang.String datum)
datum
- the datum stringpublic TrackPoint[] getTrackPoints()
public void addTrackPoint(java.lang.String type, int zoneNum, int easting, int northing, int altitude)
type
- the GpsPointRecord typezoneNum
- the UUM zone of the pointeasting
- the UTM eastingnorthing
- the UTM northingaltitude
- the altitudepublic void addTrackPoint(java.lang.String type, int zoneNum, java.lang.String zoneChar, int easting, int northing, int altitude)
type
- the GpsPointRecord typezoneNum
- the UTM zone of the pointzoneChar
- the UTM grid zone designation character (GZD)easting
- the UTM eastingnorthing
- the UTM northingaltitude
- the altitude of the pointpublic void addTrackPoint(java.lang.String type, int zoneNum, int easting, int northing, java.util.Calendar date, int altitude)
type
- the GpsPointRecord typezoneNum
- the UUM zone of the pointeasting
- the UTM eastingnorthing
- the UTM northingdate
- the date (and time) the point was takenaltitude
- the altitude of the pointsetTimeToGmt()
public void addTrackPoint(java.lang.String type, int zoneNum, java.lang.String zoneChar, int easting, int northing, java.util.Calendar date, int altitude)
type
- the GpsPointRecord typezoneNum
- the UTM zone of the pointzoneChar
- the UTM grid zone designation character (GZD)easting
- the UTM eastingnorthing
- the UTM northingdate
- the date (and time) the point was takenaltitude
- the altitude of the point
* @see #setTimeToGmt()public void addTrackPoint(java.lang.String type, int zoneNum, int easting, int northing, int month, int day, int year, int hour, int minute, int second, int altitude)
type
- the GpsPointRecord typezoneNum
- the UUM zone of the pointeasting
- the UTM eastingnorthing
- the UTM northingmonth
- the monthday
- the dayyear
- the yearhour
- the hourminute
- the minutesecond
- the secondaltitude
- the altitude of the pointCalendar
public void addTrackPoint(java.lang.String type, int zoneNum, java.lang.String zoneChar, int easting, int northing, int month, int day, int year, int hour, int minute, int second, int altitude)
type
- the GpsPointRecord typezoneNum
- the UTM zone of the pointzoneChar
- the UTM grid zone designation character (GZD)easting
- the UTM eastingnorthing
- the UTM northingmonth
- the monthday
- the dayyear
- the yearhour
- the hourminute
- the minutesecond
- the secondaltitude
- the altitude of the pointCalendar
public void setTimeToGmt()
TrackPoint
,
getZoneOffset()
public double calculateElevationEfficencyRatio()
public double calculateTrackStraightnessRatio()
public int calculateDistance()
public int calculateCumulativeDistance()
public int calculateCumulativeElevationChange()
public int calculateElevationDifference()
public int calculateMinMaxElevationDifference()
public int calculateMaximumSlope()
Calculates the maximum slope (as a percentage) between any two adjacent points in the track. Note that, internally, this method checks the configuration of the C5UTM database installation to ensure that the calculation is done with the same horizontal and vertical units. All TrackLog objects are assumed to use the same units as the database installation. This method assumes that your Tracklogs follows this rule. But it is possible that any of your own programmatically derived artificial Trackpoints (which you may produce using the TrackPoint and TrackLog class methods and constructors ), could be assuming different units. So be careful that if your TrackPoints are artificially derived programmatically, that your elevataions are in the units assumed by the database. Returns a sentinel value of -1 if there are not at least two internal TrackPoints in the TrackLog.
It is also important to note that GPS elevations, which can be +/- 100 meters in accuracy, can really distort this value.
TrackPoint
,
C5UTMconfs
public double calculateTrackStdev()
Calculates and returns the standard deviation of the elevations in the track. Note that GPS elevations often have a lot of error. It is possible to create a DbTrackLog from a TrackLog, where the coordinates will be snapped to the UTM points in the Database containing accurate ground elevations, provided the appropriate dems have been added to the database. Importantly, however, GPS records altitude, not ground elevation.
It is also important to note that GPS elevations, which are +/- 100 meters in accuracy, can really distort this value.
GpsDataFilter
public void snapToDatabase(java.sql.Connection connection)
connection
- The db connectionremoveDuplicateTrackPoints()
public void removeDuplicateTrackPoints()
public int calculateNorthingRange()
public int calculateEastingRange()
public int calculateSWcornerEasting()
public int calculateSWcornerNorthing()
public boolean isRoundTrip()
public int countTrackPoints()
public TrackLog[] segmentTrackLog()
public int[] getZones()
public TrackLog makeCopy()
public TrackLog subSegment(int from, int to) throws java.lang.ArrayIndexOutOfBoundsException
from
- the start point of the sub segmentto
- the end point of the sub segment
java.lang.ArrayIndexOutOfBoundsException
protected double getDistance(TrackPoint one, TrackPoint two)
one
- point onetwo
- point two
public int size()
public boolean equals(TrackLog trackLog)
trackLog
- the TrackLog to compare
public java.lang.String toString()
Overrides toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |