Class GeometryPositionEquality

  • All Implemented Interfaces:
    GeometryEquality
    Direct Known Subclasses:
    ApproximateGeometryEquality

    public class GeometryPositionEquality
    extends Object
    implements GeometryEquality
    A GeometryEquality that considers two Geometrys to be equal iff one of these conditions is satisfied:
    • both have the same type, coordinate reference system and consist of the same Points.
    • both are empty

    Point equality is determined by the PositionEquality instance that is passed to the constructor. In case of the default no-args constructor, ExactPositionEquality is used.

    Author:
    Karel Maesen, Geovise BVBA creation-date: 4/25/12
    • Constructor Detail

      • GeometryPositionEquality

        public GeometryPositionEquality​(PositionEquality pointEq)
        Constructs an instance that uses the specified PositionEquality to determine whether the Geometrys have the same Positionss.
        Parameters:
        pointEq -
      • GeometryPositionEquality

        public GeometryPositionEquality()
        Constructs an instance that uses ExactPositionEquality to determine whether the Geometrys have the same Positionss.
    • Method Detail

      • equals

        public <P extends Position> boolean equals​(Geometry<P> first,
                                                   Geometry<P> second)
        Checks whether the first geometry equals the second, for some definition of equality.
        Specified by:
        equals in interface GeometryEquality
        Parameters:
        first - a Geometry
        second - a second Geometry
        Returns:
        true if and only if both both Geometrys are equal.