Class DefaultTemporalCRS

    • Constructor Detail

      • DefaultTemporalCRS

        public DefaultTemporalCRS​(TemporalCRS crs)
        Constructs a new temporal CRS with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotools 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:
        crs - The coordinate reference system to copy.
        Since:
        2.2
        See Also:
        wrap(org.geotools.api.referencing.crs.TemporalCRS)
      • DefaultTemporalCRS

        public DefaultTemporalCRS​(TemporalDatum datum,
                                  TimeCS cs)
        Constructs a temporal CRS with the same properties than the given datum. The inherited properties include the name and aliases.
        Parameters:
        datum - The datum.
        cs - The coordinate system.
        Since:
        2.5
      • DefaultTemporalCRS

        public DefaultTemporalCRS​(String name,
                                  TemporalDatum datum,
                                  TimeCS cs)
        Constructs a temporal CRS from a name.
        Parameters:
        name - The name.
        datum - The datum.
        cs - The coordinate system.
      • DefaultTemporalCRS

        public DefaultTemporalCRS​(Map<String,​?> properties,
                                  TemporalDatum datum,
                                  TimeCS cs)
        Constructs a temporal CRS from a set of properties. The properties are given unchanged to the super-class constructor.
        Parameters:
        properties - Set of properties. Should contains at least "name".
        cs - The coordinate system.
        datum - The datum.
    • Method Detail

      • wrap

        public static DefaultTemporalCRS wrap​(TemporalCRS crs)
        Wraps an arbitrary temporal CRS into a Geotools implementation. This method is usefull if the user wants to take advantage of toDate(double) and toValue(java.util.Date) methods. If the supplied CRS is already an instance of DefaultTemporalCRS or is null, then it is returned unchanged.
        Parameters:
        crs - The temporal CRS to wrap.
        Returns:
        The given CRS as a DefaultTemporalCRS.
      • toDate

        public Date toDate​(double value)
        Convert the given value into a Date object. This method is the converse of toValue(java.util.Date).
        Parameters:
        value - A value in this axis unit.
        Returns:
        The value as a date.
      • toValue

        public double toValue​(Date time)
        Convert the given date into a value in this axis unit. This method is the converse of toDate(double).
        Parameters:
        time - The value as a date.
        Returns:
        value A value in this axis unit.
      • hashCode

        public int hashCode()
        Returns a hash value for this geographic CRS.
        Overrides:
        hashCode in class AbstractSingleCRS
        Returns:
        The hash code value. This value doesn't need to be the same in past or future versions of this class.