com.c5corp.c5gps
Class SimpleXYCoordinateTranslation

java.lang.Object
  extended by com.c5corp.c5gps.SimpleXYCoordinateTranslation
All Implemented Interfaces:
CoordinateTranslation

public class SimpleXYCoordinateTranslation
extends java.lang.Object
implements CoordinateTranslation

A SimpleXYCoordinateTranslation specifies a simple cartesian translation between two different WayPoints: a base and base translator. The base is a waypoint around which relative Waypoints, Routes and Tracklogs are actually defined. The base translator is used to convert these points into the region of the base translator. The translation is done via a simple an X,Y cartesian translation (maintaining north/south references) into the base translator location while maintaining the absolute relationship between the translated (orginal) data and the base. In other words, it projects data from one region into another, defined by two WayPoints, the base and the base translator. It is useful for psychogeographic exercises.

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

Constructor Summary
SimpleXYCoordinateTranslation(WayPoint base, WayPoint baseTranslator)
          Constructor
 
Method Summary
 WayPoint getBase()
          Returns the base WayPoint, or the relative base of the original points that will be translated
 WayPoint getBaseTranslator()
          Returns the base translator, or the base of the translation from the base WayPoint to the translator waypoints
 Route getTranslatedRoute(Route route)
          Accepts a Route from the base area returns a new Route translated to the base translator area, (simple XY coordinate translation.) Note: calls reset() on the Route parameter.
 TrackLog getTranslatedTrackLog(TrackLog tracklog)
          Accepts a TrackLog from the base area returns a new TrackLog translated to the base translator area, (simple XY coordinate translation.) Note: calls reset() on the tracklog.
 WayPoint getTranslatedWayPoint(WayPoint input)
          Accepts a Waypoint from the base area and returns a new Waypoint translated to the base translator area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleXYCoordinateTranslation

public SimpleXYCoordinateTranslation(WayPoint base,
                                     WayPoint baseTranslator)
Constructor

Parameters:
base - the base Waypoint
baseTranslator - the baseTranslator Waypoint to tranlate the base to
Method Detail

getTranslatedWayPoint

public WayPoint getTranslatedWayPoint(WayPoint input)
Accepts a Waypoint from the base area and returns a new Waypoint translated to the base translator area. (simply XY coordinate translation.)

Parameters:
input - relative to base (in the base area)
Returns:
the WayPoint translated into the translator area

getTranslatedRoute

public Route getTranslatedRoute(Route route)
Accepts a Route from the base area returns a new Route translated to the base translator area, (simple XY coordinate translation.) Note: calls reset() on the Route parameter. Note: this method can not handle translations of routes that contain route points that cross a UTM zone boundary. It assumes that the base zone is the target UTM zone for the translation, and simply deletes any route points from another UTM zone.

Parameters:
route -
Returns:
a route translated from this.base to this.baseTranslator

getTranslatedTrackLog

public TrackLog getTranslatedTrackLog(TrackLog tracklog)
Accepts a TrackLog from the base area returns a new TrackLog translated to the base translator area, (simple XY coordinate translation.) Note: calls reset() on the tracklog. Note: this method can not handle translations of tracklogs that contain track points that cross a UTM zone boundary. It assumes that the base zone is the target UTM zone for the translation, and simply deletes any track points from another UTM zone.

Parameters:
tracklog - the tracklog to translate
Returns:
a tracklog translated from this.base to this.baseTranslator

getBase

public WayPoint getBase()
Returns the base WayPoint, or the relative base of the original points that will be translated

Specified by:
getBase in interface CoordinateTranslation
Returns:
the base

getBaseTranslator

public WayPoint getBaseTranslator()
Returns the base translator, or the base of the translation from the base WayPoint to the translator waypoints

Specified by:
getBaseTranslator in interface CoordinateTranslation
Returns:
the base translator