Class MappedPosition

  • All Implemented Interfaces:
    Serializable

    public class MappedPosition
    extends Object
    implements Serializable
    An association between a source and target direct positions. Accuracy information and comments can optionnaly be attached.
    Since:
    2.4
    Author:
    Jan Jezek, Martin Desruisseaux
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MappedPosition​(int dimension)
      Creates a mapped position with source and target position of the specified dimension.
      MappedPosition​(Position source, Position target)
      Creates a mapped position from the specified direct positions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object object)
      Compares this mapped position with the specified object for equality.
      double getAccuracy()
      Returns an estimation of mapping accuracy in units of target CRS axis, or Double.NaN if unknow.
      String getComments()
      Returns the comments attached to this mapping, or null if none.
      Position getSource()
      Returns the source direct position.
      Position getTarget()
      Returns the target direct position.
      int hashCode()
      Returns a hash code value for this mapped position.
      void setAccuracy​(double accuracy)
      Set the accuracy.
      void setComments​(String comments)
      Set the comments attached to this mapping.
      void setSource​(Position point)
      Set the source direct position to the specified value.
      void setTarget​(Position point)
      Set the target direct position to the specified value.
      String toString()
      Returns a string representation of this mapped position.
      • Methods inherited from class Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MappedPosition

        public MappedPosition​(int dimension)
        Creates a mapped position with source and target position of the specified dimension. The initial coordinate values are 0.
      • MappedPosition

        public MappedPosition​(Position source,
                              Position target)
        Creates a mapped position from the specified direct positions.
        Parameters:
        source - The original direct position.
        target - The associated direct position.
    • Method Detail

      • getSource

        public Position getSource()
        Returns the source direct position. For performance reasons, the current implementation returns a reference to the internal object. However users should avoid to modify directly the returned position and use setSource(org.geotools.api.geometry.Position) instead.
      • setSource

        public void setSource​(Position point)
        Set the source direct position to the specified value.
      • getTarget

        public Position getTarget()
        Returns the target direct position. For performance reasons, the current implementation returns a reference to the internal object. However users should avoid to modify directly the returned position and use setTarget(org.geotools.api.geometry.Position) instead.
      • setTarget

        public void setTarget​(Position point)
        Set the target direct position to the specified value.
      • getComments

        public String getComments()
        Returns the comments attached to this mapping, or null if none.
      • setComments

        public void setComments​(String comments)
        Set the comments attached to this mapping. May be null if none.
      • getAccuracy

        public double getAccuracy()
        Returns an estimation of mapping accuracy in units of target CRS axis, or Double.NaN if unknow.
      • setAccuracy

        public void setAccuracy​(double accuracy)
        Set the accuracy.
      • hashCode

        public int hashCode()
        Returns a hash code value for this mapped position.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object object)
        Compares this mapped position with the specified object for equality.
        Overrides:
        equals in class Object
      • toString

        public String toString()
        Returns a string representation of this mapped position.
        Overrides:
        toString in class Object