com.oziexplorer
Class Position
java.lang.Object
com.oziexplorer.Position
- Direct Known Subclasses:
- GridRef, LatLon
public abstract class Position
- extends Object
This abstract class is the base for both the LatLon
and
GridRef
class herarchies, so that either type can be passed in to
methods that require a position to be specified.
Copyright 2011 Alan Burlison, . All rights reserved.
Use is subject to license terms, see
LICENSE.txt.
Field Summary |
protected static double |
comparisonAccuracy
Comparison accuracy for equals and compareTo, in metres. |
protected String |
datum
Datum the position is relative to. |
Constructor Summary |
protected |
Position()
Create a new Position object. |
protected |
Position(String datum)
Create a new Position object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
datum
protected String datum
- Datum the position is relative to.
comparisonAccuracy
protected static double comparisonAccuracy
- Comparison accuracy for equals and compareTo, in metres.
Position
protected Position()
- Create a new Position object.
Position
protected Position(String datum)
- Create a new Position object.
- Parameters:
datum
- the datum for this position
getDatum
public String getDatum()
- Return the datum of the Position.
- Returns:
- the datum of the Position
getComparisonAccuracy
public static double getComparisonAccuracy()
- Return the accuracy of position comparisons, in metres.
- Returns:
- the comparison accuracy, in metres.
setComparisonAccuracy
public static void setComparisonAccuracy(double comparisonAccuracy)
- Set the accuracy of position comparisons, in metres.
- Parameters:
comparisonAccuracy
- the comparison accuracy, in metres.
vectorBetween
public abstract SpatialVector vectorBetween(Position position)
throws OziException
- Return the distance and bearing between this position and another,
as a
SpatialVector
.
- Parameters:
position
- the Position to compare against.
- Returns:
- the distance between the two point, in metres.
- Throws:
OziException
- if OziAPI returns an error.
addVector
public abstract Position addVector(SpatialVector vector)
throws OziException
- Return a new Position which is offset from the current position by the
given vector, specified as a
SpatialVector
.
- Parameters:
vector
- the SpatialVector to offset by.
- Returns:
- the new Position.
- Throws:
OziException
- if OziAPI returns an error.