Class DefaultDatumEnsemble<D extends Datum>
Object
FormattableObject
AbstractIdentifiedObject
DefaultDatumEnsemble<D>
- Type Parameters:
D- the type of datum members contained in this ensemble.
- All Implemented Interfaces:
Serializable, Formattable, Deprecable, LenientComparable, Printable, Datum, IdentifiedObject
@UML(identifier="DatumEnsemble",
specification=ISO_19111)
public class DefaultDatumEnsemble<D extends Datum>
extends AbstractIdentifiedObject
implements Datum
Collection of datums which for low accuracy requirements may be considered
to be insignificantly different from each other.
Coordinate transformations between different members of an ensemble
can be omitted if the ensemble accuracy is sufficient.
Ensemble viewed as a datum
While aDatumEnsemble is theoretically not a Datum,
it is sometime convenient to handle the ensemble as if it was a datum.
Therefore, Apache SIS implementation of DatumEnsemble implements also the Datum interface.
This is a non-standard approach for making easier to handle Datum and DatumEnsemble with the same code.
A similar approach is used in the EPSG database, which stores ensembles in the same table as the datums.
It is illegal to use this double inheritance for returning a DatumEnsemble from
SingleCRS.getDatum(), or for creating a DatumEnsemble
containing a nested DatumEnsemble. The Apache SIS constructors verify these constraints.
For getting a single object which may be a datum or an ensemble, see the DatumOrEnsemble static methods.
- Since:
- 1.5
- See Also:
-
Field Summary
Fields inherited from class AbstractIdentifiedObject
DEPRECATED_KEY, DOMAINS_KEY, LOCALE_KEYModifier and TypeFieldDescriptionstatic final StringOptional key which can be given to the constructor for specifying the object is deprecated.static final StringKey for the"domains"property to be given to theObjectFactory.createFoo(Map, ...)methods.static final StringOptional key which can be given to the constructor for specifying the locale to use for producing error messages.Fields inherited from interface Datum
ANCHOR_POINT_KEY, DOMAIN_OF_VALIDITY_KEY, REALIZATION_EPOCH_KEY, SCOPE_KEYFields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultDatumEnsemble(Map<String, ?> properties, Collection<? extends D> members, PositionalAccuracy accuracy, Class<D> memberType) Creates a datum ensemble from the given properties.protectedDefaultDatumEnsemble(DefaultDatumEnsemble<? extends D> ensemble, Class<D> memberType) Creates a new ensemble with the same values as the specified one. -
Method Summary
Modifier and TypeMethodDescription<N extends Datum>
DefaultDatumEnsemble<N> Returns this datum ensemble as a collection of datum of the given type.static <D extends Datum>
DefaultDatumEnsemble<D> create(Map<String, ?> properties, Class<D> memberType, Collection<? extends D> members, PositionalAccuracy accuracy) Creates a datum ensemble from the given properties.Returns an anchor point which is common to all members of the datum ensemble.Returns a domain of validity which is common to all members of the datum ensemble.Returns the inaccuracy introduced through use of this ensemble.doubleReturns an estimation of positional accuracy in metres, orNaNif unknown.final Collection<D> Returns the datum or reference frames which are members of this ensemble.Returns a realization epoch which is common to all members of the datum ensemble.Returns a scope which is common to all members of the datum ensemble.Returns the GeoAPI interface that defines the contract of this implementation class.booleanReturnstrueif either the primary name or at least one alias matches the given string according heuristic rules.Methods inherited from class AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getDomains, getIdentifiers, getInterface, getName, getRemarks, hashCode, isDeprecatedModifier and TypeMethodDescriptionstatic AbstractIdentifiedObjectcastOrCopy(IdentifiedObject object) Returns a SIS identified object implementation with the values of the given arbitrary implementation.final booleanCompares the specified object with this object for equality.voidFormats the name or identifier of this object using the provider formatter.Returns alternative names by which this object is identified.Returns a narrative explanation of the role of this object.Returns the usage of this CRS-related object.Returns identifiers which references elsewhere the object's defining information.final Class<? extends IdentifiedObject> Deprecated, for removal: This API element is subject to removal in a future version.getName()Returns the primary name by which this object is identified.Returns comments on or information about this object, including data source information.final intReturns a hash value for this identified object.booleanReturnstrueif this object is deprecated.Methods inherited from class FormattableObject
print, toString, toString, toWKTModifier and TypeMethodDescriptionvoidprint()Prints a string representation of this object to the standard output stream.Returns a Well Known Text (WKT) or an alternative text representation for this object.toString(Convention convention) Returns a Well Known Text (WKT) for this object using the specified convention.toWKT()Returns a strictly compliant Well Known Text (WKT) using the default convention, symbols and indentation.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface IdentifiedObject
toWKT
-
Constructor Details
-
DefaultDatumEnsemble
protected DefaultDatumEnsemble(Map<String, ?> properties, Collection<? extends D> members, PositionalAccuracy accuracy, Class<D> memberType) Creates a datum ensemble from the given properties. The properties given in argument follow the same rules as for the super-class constructor.Recognized properties (non exhaustive list) Property name Value type Returned by "name" orinvalid reference
IdentifierStringAbstractIdentifiedObject.getName()"alias" orinvalid reference
GenericNameCharSequence(optionally as array)AbstractIdentifiedObject.getAlias()"identifiers" (optionally as array)invalid reference
IdentifierAbstractIdentifiedObject.getIdentifiers()"domains"(optionally as array)invalid reference
org.opengis.referencing.ObjectDomainAbstractIdentifiedObject.getDomains()"remarks" InternationalStringorStringAbstractIdentifiedObject.getRemarks()- Parameters:
properties- the properties to be given to the identified object.members- datum or reference frames which are members of this ensemble.accuracy- inaccuracy introduced through use of this ensemble (mandatory).memberType- the base type of datum members contained in this ensemble.- Throws:
ClassCastException- if a member is not an instance ofmemberType.IllegalArgumentException- if a member is an instance ofDatumEnsemble, of if at least two different conventional reference systems are found.- See Also:
-
DefaultDatumEnsemble
Creates a new ensemble with the same values as the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.This constructor performs a shallow copy, i.e. the properties are not cloned.
- Parameters:
ensemble- the ensemble to copy.memberType- the base type of datum members contained in this ensemble.- Throws:
ClassCastException- if a member is not an instance ofmemberType.IllegalArgumentException- if a member is an instance ofDatumEnsemble, of if at least two different conventional reference systems are found.
-
-
Method Details
-
create
public static <D extends Datum> DefaultDatumEnsemble<D> create(Map<String, ?> properties, Class<D> memberType, Collection<? extends D> members, PositionalAccuracy accuracy) Creates a datum ensemble from the given properties. The content of thepropertiesmap is described in the constructor. The returned ensemble may implement theGeodeticDatum,VerticalDatum,TemporalDatum, orEngineeringDatuminterface if all members are instances of the same interface.- Type Parameters:
D- the type of datum members contained in the ensemble to create.- Parameters:
properties- the properties to be given to the identified object.memberType- type of members, ornullfor automatic.members- datum or reference frames which are members of this ensemble.accuracy- inaccuracy introduced through use of this ensemble (mandatory).- Returns:
- the datum ensemble.
- Throws:
IllegalArgumentException- if a member is an instance ofDatumEnsemble, of if at least two different conventional reference systems are found.
-
cast
Returns this datum ensemble as a collection of datum of the given type. This method casts the datum members, it does not copy or rewrite them. However, the returnedDatumEnsemblemay be a different instance.- Type Parameters:
N- compile-time value ofmemberType.- Parameters:
memberType- the new desired type of datum members.- Returns:
- an ensemble of datum of the given type.
- Throws:
ClassCastException- if at least one member is not an instance of the specified type.
-
getStandardType
Returns the GeoAPI interface that defines the contract of this implementation class. This is the base type required byequals(…)methods for returning a potentiallytruevalue.- Specified by:
getStandardTypein interfaceLenientComparable- Overrides:
getStandardTypein classAbstractIdentifiedObject- Returns:
DatumEnsemble.classor a user-defined sub-interface.- Since:
- 1.7
- See Also:
-
getMembers
Returns the datum or reference frames which are members of this ensemble. The returned list is immutable.- Returns:
- datum or reference frames which are members of this ensemble.
-
getEnsembleAccuracy
Returns the inaccuracy introduced through use of this ensemble.- Returns:
- inaccuracy introduced through use of this ensemble.
-
getLinearAccuracy
public double getLinearAccuracy()Returns an estimation of positional accuracy in metres, orNaNif unknown. If at least one quantitative result is found with a linear unit, then returns the largest result value converted to metres.- Returns:
- the accuracy estimation (always in meters), or NaN if unknown.
- See Also:
-
getAnchorPoint
Returns an anchor point which is common to all members of the datum ensemble. If the value is not the same for all members, or if at least one member returned null, then this method returns null.- Specified by:
getAnchorPointin interfaceDatum- Returns:
- the common anchor point, or null if there is no common value.
-
getRealizationEpoch
Returns a realization epoch which is common to all members of the datum ensemble. If the value is not the same for all members, or if at least one member returned null, then this method returns null.- Specified by:
getRealizationEpochin interfaceDatum- Returns:
- the common realization epoch, null if there is no common value.
-
getDomainOfValidity
Returns a domain of validity which is common to all members of the datum ensemble. If the value is not the same for all members, or if at least one member returned null, then this method returns null.- Specified by:
getDomainOfValidityin interfaceDatum- Returns:
- the common domain of validity, or null if there is no common value.
-
getScope
Returns a scope which is common to all members of the datum ensemble. If the value is not the same for all members, or if at least one member returned null, then this method returns null. -
isHeuristicMatchForName
Returnstrueif either the primary name or at least one alias matches the given string according heuristic rules. This method performs the comparison documented in the datum class.- Overrides:
isHeuristicMatchForNamein classAbstractIdentifiedObject- Parameters:
name- the name to compare.- Returns:
trueif the primary name or at least one alias matches the specifiedname.- See Also:
-
AbstractIdentifiedObject.getStandardType()for integration withLenientComparable.