Class DefaultDatumEnsemble<D extends Datum>

Type Parameters:
D - the type of datum members contained in this ensemble.
All Implemented Interfaces:
Serializable, Formattable, Deprecable, Lenient­Comparable, Printable, Datum, Identified­Object

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 a Datum­Ensemble is theoretically not a Datum, it is sometime convenient to handle the ensemble as if it was a datum. Therefore, Apache SIS implementation of Datum­Ensemble implements also the Datum interface. This is a non-standard approach for making easier to handle Datum and Datum­Ensemble 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 Datum­Ensemble from Single­CRS​.get­Datum(), or for creating a Datum­Ensemble containing a nested Datum­Ensemble. The Apache SIS constructors verify these constraints. For getting a single object which may be a datum or an ensemble, see the Datum­Or­Ensemble static methods.

Since:
1.5
See Also:
  • Constructor Details

  • 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 the properties map is described in the constructor. The returned ensemble may implement the Geodetic­Datum, Vertical­Datum, Temporal­Datum, or Engineering­Datum interface 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.
      member­Type - type of members, or null for 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:
      Illegal­Argument­Exception - if a member is an instance of Datum­Ensemble, of if at least two different conventional reference systems are found.
    • cast

      public <N extends Datum> DefaultDatumEnsemble<N> cast(Class<N> memberType)
      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 returned Datum­Ensemble may be a different instance.
      Type Parameters:
      N - compile-time value of member­Type.
      Parameters:
      member­Type - the new desired type of datum members.
      Returns:
      an ensemble of datum of the given type.
      Throws:
      Class­Cast­Exception - if at least one member is not an instance of the specified type.
    • getMembers

      public final Collection<D> 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

      public PositionalAccuracy 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, or Na­N if 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

      public InternationalString 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:
      get­Anchor­Point in interface Datum
      Returns:
      the common anchor point, or null if there is no common value.
    • getRealizationEpoch

      public Date 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:
      get­Realization­Epoch in interface Datum
      Returns:
      the common realization epoch, null if there is no common value.
    • getDomainOfValidity

      public Extent 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:
      get­Domain­Of­Validity in interface Datum
      Returns:
      the common domain of validity, or null if there is no common value.
    • getScope

      public InternationalString 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.
      Specified by:
      get­Scope in interface Datum
      Returns:
      the common scope, or null if there is no common value.
    • isHeuristicMatchForName

      public boolean isHeuristicMatchForName(String name)
      Returns true if 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:
      is­Heuristic­Match­For­Name in class Abstract­Identified­Object
      Parameters:
      name - the name to compare.
      Returns:
      true if the primary name or at least one alias matches the specified name.
      See Also: