com.c5corp.c5gps
Class WayPoint

java.lang.Object
  extended by com.c5corp.c5gps.GpsType
      extended by com.c5corp.c5gps.GpsPointRecord
          extended by com.c5corp.c5gps.WayPoint
Direct Known Subclasses:
RoutePoint

public class WayPoint
extends GpsPointRecord

A WayPoint is a named location. Waypoints are independent entities - but may be organized into routes. See the Route class. There is a 1:M relationship between between routes and waypoints (but a waypoint is not required to be part of a route.)

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. Also, note that the name field will often be further truncated by a GPS device if you are uploading derived points to the GPS. Although this class allows up to 255 characters, most GPS devices will allow far fewer.

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

Field Summary
 
Fields inherited from class com.c5corp.c5gps.GpsType
hdatum
 
Constructor Summary
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, int easting, int northing)
          Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, and UTM northing.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, int easting, int northing, java.util.Calendar date)
          Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, and UTM northing.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, int easting, int northing, int altitude)
          Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, UTM northing, and altitude.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, int easting, int northing, int altitude, java.util.Calendar date)
          Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, UTM northing, and altitude.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, int easting, int northing, int month, int day, int year, int hour, int minute, int second, int timeZoneOffset)
          Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, int easting, int northing, int altitude, int month, int day, int year, int hour, int minute, int second, int timeZoneOffset)
          Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, java.lang.String zoneChar, int easting, int northing)
          Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, zone Char, UTM easting, and UTM northing.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, java.lang.String zoneChar, int easting, int northing, java.util.Calendar date)
          Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, zone Char, UTM easting, and UTM northing.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, java.lang.String zoneChar, int easting, int northing, int altitude)
          Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone char, UTM easting, UTM northing, and altitude.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, java.lang.String zoneChar, int easting, int northing, int altitude, java.util.Calendar date)
          Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, and java.util.Calendar object.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, java.lang.String zoneChar, int easting, int northing, int month, int day, int year, int hour, int minute, int second, int timeZoneOffset)
          Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset.
WayPoint(java.lang.String datum, java.lang.String name, int zoneNum, java.lang.String zoneChar, int easting, int northing, int altitude, int month, int day, int year, int hour, int minute, int second, int timeZoneOffset)
          Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset.
 
Method Summary
 boolean equals(WayPoint wayPoint)
          Compares the planametric values of another WayPoint to this to see if they are equivalent.
 int getAltitude()
          returns the WayPoint altitude.
 java.util.Calendar getDate()
          returns the WayPoint Date
 java.lang.String getDatum()
          accessor for the datum string
 int getEasting()
          returns the WayPoint eastin
 int getNorthing()
          returns the WayPoint northing
 java.lang.String getType()
          The type of any gps record is one of the following: W, for a wapoint, N or T for trackpoint (N being a new trackpoint, or the first trackpoint recorded after a device has lost satellite tracking), and R for a RoutePoint.
 UtmCoordinatePairElev getUtmCoordinatePairElev()
          returns a artificial UtmCoordinatePairElev object representation of the point
 java.lang.String getVersion()
          version (such as "Version 2:CSV").
 java.lang.String getWayPointName()
          gets the name of this WayPoint
 int getZone()
          returns the WayPoint zone number
 java.lang.String getZoneChar()
          returns the WayPoint zone char, which may be an empty string if there was no grid zone designation character (GZD) data at the time of construction.
 int getZoneOffset()
          returns the zone offset from GMT for this waypoint
 void setAltitude(int altitude)
          sets the WayPoint altitude
 void setDate(java.util.Calendar date)
          sets the WayPoint Date
 void setDatum(java.lang.String datum)
          mutator for the datum string
 void setEasting(int easting)
          sets the WayPoint easting
 void setNorthing(int northing)
          sets the WayPoint northing
 void setTimeToGmt()
          Coverts the date/time for this WayPoint to UTC/GMT time
 void setVersion(java.lang.String version)
          Sets the Version String, which by default is "Version 2:CSV".
 void setWaypointName(java.lang.String name)
          mutator for track name
 void setZoneNum(int zoneNum)
          sets the WayPoint zone number
 void setZoneNum(java.lang.String zoneChar)
          sets the WayPoint Grid Zone Designation (GZD)
 java.lang.String toString()
          override toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                java.lang.String zoneChar,
                int easting,
                int northing,
                int altitude)
Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone char, UTM easting, UTM northing, and altitude. Uses a default date, local system time.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
zoneChar - UTM Grid Zone Designation (GZD)
easting - UTM easting
northing - UTM northing
altitude - Altitude of the WayPoint

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                java.lang.String zoneChar,
                int easting,
                int northing)
Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, zone Char, UTM easting, and UTM northing. Uses a default date, local system time.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
zoneChar - UTM grid zone designation character (GZD)
easting - UTM easting
northing - UTM northing

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                int easting,
                int northing,
                int altitude)
Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, UTM northing, and altitude. Uses a default date, local system time.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
easting - UTM easting
northing - UTM northing
altitude - Altitude of the WayPoint

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                int easting,
                int northing)
Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, and UTM northing. Uses a default date, local system time.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
easting - UTM easting
northing - UTM northing

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                java.lang.String zoneChar,
                int easting,
                int northing,
                int altitude,
                java.util.Calendar date)
Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, and java.util.Calendar object.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
zoneChar - UTM grid zone designation character (GZD)
easting - UTM easting
northing - UTM northing
altitude - Altitude of the WayPoint
date - a java.util.Calendar representing date and time

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                java.lang.String zoneChar,
                int easting,
                int northing,
                java.util.Calendar date)
Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, zone Char, UTM easting, and UTM northing. The Calendar passed into this object can be modified to GMT with setTimeToGmt().

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
zoneChar - UTM grid zone designation character (GZD)
easting - UTM easting
northing - UTM northing
date - Calendar representing the date/time
See Also:
setTimeToGmt()

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                int easting,
                int northing,
                int altitude,
                java.util.Calendar date)
Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, UTM northing, and altitude. The Calendar passed into this object can be modified to GMT with setTimeToGmt().

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
easting - UTM easting
northing - UTM northing
altitude - Altitude of the WayPoint
date - a java.util.Calendar representing date and time
See Also:
setTimeToGmt()

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                int easting,
                int northing,
                java.util.Calendar date)
Construct a WayPoint with a name (which will be truncated to 255 characters, zone number, UTM easting, and UTM northing. The Calendar passed into this object can be modified to GMT with setTimeToGmt().

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
easting - UTM easting
northing - UTM northing
date - a java.util.Calendar representing date and time
See Also:
setTimeToGmt()

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                java.lang.String zoneChar,
                int easting,
                int northing,
                int altitude,
                int month,
                int day,
                int year,
                int hour,
                int minute,
                int second,
                int timeZoneOffset)
Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset. Using the time zone offset, the internal Calendar will be converted to GMT.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
zoneChar - UTM grid zone designation character (GZD)
easting - UTM easting
northing - UTM northing
altitude - Altitude of the WayPoint
month - - month
day - - day
year - - year
hour - - hour
minute - - minute
second - - second
timeZoneOffset - - time zone offset

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                int easting,
                int northing,
                int altitude,
                int month,
                int day,
                int year,
                int hour,
                int minute,
                int second,
                int timeZoneOffset)
Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset. Using the time zone offset, the internal Calendar will be converted to GMT.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
easting - UTM easting
northing - UTM northing
altitude - Altitude of the WayPoint
month - - month
day - - day
year - - year
hour - - hour
minute - - minute
second - - second
timeZoneOffset - - time zone offset

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                int easting,
                int northing,
                int month,
                int day,
                int year,
                int hour,
                int minute,
                int second,
                int timeZoneOffset)
Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset. Using the time zone offset, the internal Calendar will be converted to GMT.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
easting - UTM easting
northing - UTM northing
month - - month
day - - day
year - - year
hour - - hour
minute - - minute
second - - second
timeZoneOffset - - time zone offset

WayPoint

public WayPoint(java.lang.String datum,
                java.lang.String name,
                int zoneNum,
                java.lang.String zoneChar,
                int easting,
                int northing,
                int month,
                int day,
                int year,
                int hour,
                int minute,
                int second,
                int timeZoneOffset)
Construct a WayPoint with a name (which will be truncated to 255 characters), zone number, zone Char, UTM easting, UTM northing, altitude, month, day, year, hour, minute, second, and a time zone offset. Using the time zone offset, the internal Calendar will be converted to GMT.

Parameters:
datum - - a string representing the datum - an empty string will default this to the configured database install
name - Waypoint name, up to 255 chars
zoneNum - UTM zone number
zoneChar - UTM grid zone designation character (GZD)
easting - UTM easting
northing - UTM northing
month - - month
day - - day
year - - year
hour - - hour
minute - - minute
second - - second
timeZoneOffset - - time zone offset
Method Detail

getVersion

public java.lang.String getVersion()
version (such as "Version 2:CSV"). The user is responsible for setting this value if they wish to override the default values of any com.c5corp.c5gps.filters.AbstractGpsFilter that may be used. The filters will normally know the correct version info and might override the user value.

Returns:
the g7towin version
See Also:
GpsDataFilter

getType

public java.lang.String getType()
The type of any gps record is one of the following: W, for a wapoint, N or T for trackpoint (N being a new trackpoint, or the first trackpoint recorded after a device has lost satellite tracking), and R for a RoutePoint. There is also an E for an end of Route marker, in g7towin csv files, but it is not a point data item marker. This being a waypoint, the type is "W".

Specified by:
getType in class GpsPointRecord
Returns:
the Gps Record Type of this GpsPointRecord

getDatum

public java.lang.String getDatum()
accessor for the datum string

Specified by:
getDatum in class GpsPointRecord
Returns:
String representing the datum
See Also:
GpsType.hdatum

getWayPointName

public java.lang.String getWayPointName()
gets the name of this WayPoint

Returns:
the waypoint name

getZone

public int getZone()

returns the WayPoint zone number

Specified by:
getZone in class GpsPointRecord
Returns:
the UTM zone

getZoneChar

public java.lang.String getZoneChar()

returns the WayPoint zone char, which may be an empty string if there was no grid zone designation character (GZD) data at the time of construction.

Returns:
the UTM grid zone designation

getEasting

public int getEasting()

returns the WayPoint eastin

Specified by:
getEasting in class GpsPointRecord
Returns:
the UTM easting

getNorthing

public int getNorthing()

returns the WayPoint northing

Specified by:
getNorthing in class GpsPointRecord
Returns:
the UTM northing

getDate

public java.util.Calendar getDate()
returns the WayPoint Date

Returns:
Calendar representing the date/time
See Also:
Date

getAltitude

public int getAltitude()
returns the WayPoint altitude. Note that a ridiculous sentinel value of -1000000 will be returned if there was no altitude data at the time of construction.

Returns:
the altitude value, or -100000 (sentinel for none)

getUtmCoordinatePairElev

public UtmCoordinatePairElev getUtmCoordinatePairElev()
returns a artificial UtmCoordinatePairElev object representation of the point

Returns:
a UtmCoordinatePairElev representation of this WayPoint

setVersion

public void setVersion(java.lang.String version)
Sets the Version String, which by default is "Version 2:CSV". Very rarely will this need to be anything else, as it applies to CSV files produced with g7towin.

Parameters:
version - the g7towin version

setWaypointName

public void setWaypointName(java.lang.String name)
mutator for track name

Parameters:
name - the WayPoint Name

setDatum

public void setDatum(java.lang.String datum)
mutator for the datum string

Parameters:
datum - the datum value

setZoneNum

public void setZoneNum(int zoneNum)
sets the WayPoint zone number

Parameters:
zoneNum - the UTM zone

setZoneNum

public void setZoneNum(java.lang.String zoneChar)
sets the WayPoint Grid Zone Designation (GZD)

Parameters:
zoneChar - the UTM grid zone designation

setEasting

public void setEasting(int easting)
sets the WayPoint easting

Parameters:
easting - the UTM easting

setNorthing

public void setNorthing(int northing)
sets the WayPoint northing

Parameters:
northing - the UTM northing

setDate

public void setDate(java.util.Calendar date)
sets the WayPoint Date

Parameters:
date - a Calendar representing the date/time
See Also:
Date

setAltitude

public void setAltitude(int altitude)
sets the WayPoint altitude

Parameters:
altitude - the altitude

setTimeToGmt

public void setTimeToGmt()
Coverts the date/time for this WayPoint to UTC/GMT time


getZoneOffset

public int getZoneOffset()
returns the zone offset from GMT for this waypoint

Returns:
the time zone offset

equals

public boolean equals(WayPoint wayPoint)
Compares the planametric values of another WayPoint to this to see if they are equivalent.

Parameters:
wayPoint - the WayPoint to compare
Returns:
true if the WayPoints are equal

toString

public java.lang.String toString()
override toString()

Overrides:
toString in class java.lang.Object