public class DefaultPrimeMeridian extends AbstractIdentifiedObject implements PrimeMeridian
Choice 1 in the following list is the easiest but most restrictive way to get a prime meridian. The other choices provide more freedom. Each choice delegates its work to the subsequent items (in the default configuration), so this list can been seen as top to bottom API.
PrimeMeridian from one of the static convenience shortcuts listed in
CommonCRS.primeMeridian().PrimeMeridian from an identifier in a database by invoking
DatumAuthorityFactory.createPrimeMeridian(String).PrimeMeridian by invoking the DatumFactory.createPrimeMeridian(…) method
(implemented for example by GeodeticObjectFactory).DefaultPrimeMeridian by invoking the
constructor.PrimeMeridian pm = CommonCRS.WGS84.primeMeridian();
CommonCRS.primeMeridian(),
GeodeticAuthorityFactory.createPrimeMeridian(String),
Serialized FormDefined in the sis-referencing module
DEPRECATED_KEY, LOCALE_KEYALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY| Modifier | Constructor and Description |
|---|---|
|
DefaultPrimeMeridian(Map<String,?> properties,
double greenwichLongitude,
Unit<Angle> angularUnit)
Creates a prime meridian from the given properties.
|
protected |
DefaultPrimeMeridian(PrimeMeridian meridian)
Creates a new prime meridian with the same values than the specified one.
|
| Modifier and Type | Method and Description |
|---|---|
static DefaultPrimeMeridian |
castOrCopy(PrimeMeridian object)
Returns a SIS prime meridian implementation with the same values than the given arbitrary implementation.
|
protected long |
computeHashCode()
Invoked by
hashCode() for computing the hash code when first needed. |
boolean |
equals(Object object,
ComparisonMode mode)
Compares this prime meridian with the specified object for equality.
|
protected String |
formatTo(Formatter formatter)
Formats this prime meridian as a Well Known Text
PrimeMeridian[…] element. |
Unit<Angle> |
getAngularUnit()
Returns the angular unit of the Greenwich longitude.
|
double |
getGreenwichLongitude()
Longitude of the prime meridian measured from the Greenwich meridian, positive eastward.
|
double |
getGreenwichLongitude(Unit<Angle> unit)
Returns the longitude value relative to the Greenwich Meridian, expressed in the specified units.
|
Class<? extends PrimeMeridian> |
getInterface()
Returns the GeoAPI interface implemented by this class.
|
castOrCopy, equals, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForNameprint, toString, toString, toWKTclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAlias, getIdentifiers, getName, getRemarks, toWKTpublic DefaultPrimeMeridian(Map<String,?> properties, double greenwichLongitude, Unit<Angle> angularUnit)
| Property name | Value type | Returned by |
|---|---|---|
| "name" | ReferenceIdentifier or String |
AbstractIdentifiedObject.getName() |
| "alias" | GenericName or CharSequence (optionally as array) |
AbstractIdentifiedObject.getAlias() |
| "identifiers" | ReferenceIdentifier (optionally as array) |
AbstractIdentifiedObject.getIdentifiers() |
| "remarks" | InternationalString or String |
AbstractIdentifiedObject.getRemarks() |
properties - the properties to be given to the identified object.greenwichLongitude - the longitude value relative to the Greenwich Meridian.angularUnit - the angular unit of the longitude.GeodeticObjectFactory.createPrimeMeridian(Map, double, Unit)protected DefaultPrimeMeridian(PrimeMeridian meridian)
This constructor performs a shallow copy, i.e. the properties are not cloned.
meridian - the prime meridian to copy.castOrCopy(PrimeMeridian)public static DefaultPrimeMeridian castOrCopy(PrimeMeridian object)
null, then this method returns null.
Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.object - the object to get as a SIS implementation, or null if none.null if the argument was null.public Class<? extends PrimeMeridian> getInterface()
PrimeMeridian.class.
PrimeMeridian
sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with their
own set of interfaces.getInterface in class AbstractIdentifiedObjectPrimeMeridian.class or a user-defined sub-interface.public double getGreenwichLongitude()
getGreenwichLongitude in interface PrimeMeridianpublic double getGreenwichLongitude(Unit<Angle> unit)
double longitudeInDegrees = primeMeridian.getGreenwichLongitude(Units.DEGREE);
unit - the unit in which to express longitude.public Unit<Angle> getAngularUnit()
getAngularUnit in interface PrimeMeridianpublic boolean equals(Object object, ComparisonMode mode)
equals in interface LenientComparableequals in class AbstractIdentifiedObjectobject - the object to compare to this.mode - STRICT for performing a strict comparison, or
IGNORE_METADATA for comparing only properties
relevant to coordinate transformations.true if both objects are equal.AbstractIdentifiedObject.computeHashCode(),
Utilities.deepEquals(Object, Object, ComparisonMode)protected long computeHashCode()
hashCode() for computing the hash code when first needed.
See AbstractIdentifiedObject.computeHashCode()
for more information.computeHashCode in class AbstractIdentifiedObjectprotected String formatTo(Formatter formatter)
PrimeMeridian[…] element.formatTo in class AbstractIdentifiedObjectformatter - the formatter where to format the inner content of this WKT element."PrimeMeridian" (WKT 2) or "PrimeM" (WKT 1).Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.