Package uk.co.mccombe.mapping
Class CoordinateSystem
java.lang.Object
uk.co.mccombe.mapping.CoordinateSystem
- Direct Known Subclasses:
Projection
,Spherical
Abstract base class for coordinate systems in general.
Each instance of CoordinateSystem contains a Position and references to the
Ellipsoid and Datum from which the coordinates are derived. The position itself is
independent of Ellipsoid and Datum.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance of CoordinateSystem using the default Ellipsoid and DatumCoordinateSystem
(Position pos, Ellipsoid e, Datum d) Create a new instance of CoordinateSystem for a specific Position, Ellipsoid and Datum -
Method Summary
Modifier and TypeMethodDescriptionabstract Datum
Get the defaul Datum for an instance of CoordinateSystem.abstract Ellipsoid
The default Ellipsoid used by instances of this CoordinateSystem For example, a CoordinateSystem of type OSGB has the AirySphere as its default EllipsoidgetDatum()
Get the Datum used by this pointGet the Ellipsoid used by this pointgetName()
Get the name of this CoordinateSystem.Get the Position of this pointgetWGS84()
Get the "absolute" cartesian coordinates for this location.protected static double
Get the Latitude and Longitude for this point.Return a String containing values of Latitude and Longitude.referred to the current Ellipsoid and Datumabstract String
toString()
Provide a String representing the position in a correct format for the CoordinateSystem
-
Field Details
-
locus
The Position of this Coordinate -
sph
The Ellipsoid for this point -
ref
The Datum for this point
-
-
Constructor Details
-
CoordinateSystem
protected CoordinateSystem()Creates a new instance of CoordinateSystem using the default Ellipsoid and Datum -
CoordinateSystem
Create a new instance of CoordinateSystem for a specific Position, Ellipsoid and Datum
- Parameters:
pos
- Position of the point in this CoordinateSysteme
- Ellipsoid to be used in this CoordinateSystemd
- Datum for this instance of CopordinateSystem
-
-
Method Details
-
toLatLong
Get the Latitude and Longitude for this point. Note the result is referred to the current datum and ellipsoid- Returns:
- LatLong object containing latitude and longitude
-
toLatLongString
Return a String containing values of Latitude and Longitude.referred to the current Ellipsoid and Datum- Returns:
- String containing Latitude and Longitude in degrees. North or East are represented by positive values, South or West are negative.
-
getDatum
Get the Datum used by this point- Returns:
- The Datum associated with this point
-
getEllipsoid
Get the Ellipsoid used by this point- Returns:
- Ellipsoid
-
getName
Get the name of this CoordinateSystem. By default, this method returns the short name of the class. For example, an instance of
mccombe.mapping.IrishGrid
returns the name "IrishGrid".Implementers of sub-classes of CoordinateSystem are encouraged to override this method if a more descriptive name is needed
- Returns:
- The name of the CoordinateSystem
-
getPosition
Get the Position of this point- Returns:
- The Position of this point
-
getWGS84
Get the "absolute" cartesian coordinates for this location. These are based on the WGS-84 datum and coordinate system.- Returns:
- XYZ object containing the cartesian coordinates for this point.
-
defaultEllipsoid
The default Ellipsoid used by instances of this CoordinateSystem For example, a CoordinateSystem of type OSGB has the AirySphere as its default Ellipsoid- Returns:
- The Ellipsoid used as the deafult for this CoordinateSystem
-
defaultDatum
Get the defaul Datum for an instance of CoordinateSystem. For example, instances of OSGB usually use the OSGB 1936 datum.- Returns:
- The default Datum used by this instance of CoordinateSystem
-
toString
Provide a String representing the position in a correct format for the CoordinateSystem -
parseDouble
- Throws:
ParseException
-