Class JTSGeometryOperations

  • All Implemented Interfaces:
    ProjectedGeometryOperations

    public class JTSGeometryOperations
    extends Object
    implements ProjectedGeometryOperations
    An implementation of ProjectedGeometryOperations that delegates to the corresponding JTS operations.
    Author:
    Karel Maesen, Geovise BVBA creation-date: 5/3/11
    • Constructor Detail

      • JTSGeometryOperations

        public JTSGeometryOperations()
    • Method Detail

      • isSimple

        public <P extends C2D> boolean isSimple​(Geometry<P> geometry)
        Description copied from interface: ProjectedGeometryOperations
        Tests the simplicity of the specified Geometry.
        Specified by:
        isSimple in interface ProjectedGeometryOperations
        Parameters:
        geometry - the Geometry to test for simplicity.
        Returns:
        True iff the specified Geometry is simple.
      • boundary

        public <P extends C2DGeometry<P> boundary​(Geometry<P> geometry)
        Description copied from interface: ProjectedGeometryOperations
        Calculates the boundary of the specified Geometry.
        Specified by:
        boundary in interface ProjectedGeometryOperations
        Parameters:
        geometry - the Geometry for which to calculate the boundary.
        Returns:
        a Geometry representing the boundary of the specified Geometry.
      • reverse

        public <P extends C2D,​G extends Geometry<P>> G reverse​(G geometry)
        Creates a Geometry having as coordinates the coordinates of the input Geometry in reverse order.
        Specified by:
        reverse in interface ProjectedGeometryOperations
        Parameters:
        geometry - the Geometry to reverse
        Returns:
        a Geometry with the same coordinates as the specified input Geometry but in reverse order
      • intersects

        public <P extends C2D> boolean intersects​(Geometry<P> geometry,
                                                  Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Checks if the specified Geometrys intersect.
        Specified by:
        intersects in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry operand of the intersection test
        other - the second Geometry operand of the intersection test
        Returns:
        true iff the specified Geometrys spatially intersect
      • touches

        public <P extends C2D> boolean touches​(Geometry<P> geometry,
                                               Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Checks if the specified Geometrys touch.
        Specified by:
        touches in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry operand of the touch test
        other - the second Geometry operand of the touch test
        Returns:
        true iff the specified Geometrys spatially touch
      • crosses

        public <P extends C2D> boolean crosses​(Geometry<P> geometry,
                                               Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Checks if the specified Geometrys cross.
        Specified by:
        crosses in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry operand of the cross test
        other - the second Geometry operand of the cross test
        Returns:
        true iff the specified Geometrys spatially cross
      • contains

        public <P extends C2D> boolean contains​(Geometry<P> geometry,
                                                Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Checks if the first specified Geometry spatially contains the second.
        Specified by:
        contains in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry operand of the containment test
        other - the second Geometry operand of the containment test
        Returns:
        true iff the first specified Geometry spatially contains the second
      • overlaps

        public <P extends C2D> boolean overlaps​(Geometry<P> geometry,
                                                Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Checks if the specified Geometrys overlap.
        Specified by:
        overlaps in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry operand of the overlap test
        other - the second Geometry operand of the overlap test
        Returns:
        true iff the specified Geometrys spatially overlap
      • relates

        public <P extends C2D> boolean relates​(Geometry<P> geometry,
                                               Geometry<P> other,
                                               String matrix)
        Description copied from interface: ProjectedGeometryOperations
        Checks if the specified Geometrys are spatially related by testing for intersections between the interior, boundary and exterior of the two geometric objects as specified by the values in the intersection pattern matrix. This returns false if all the tested intersections are empty except exterior (this) intersect exterior (another).
        Specified by:
        relates in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry operand of the relates test
        other - the second Geometry operand of the relates test
        matrix - the intersection pattern matrix
        Returns:
        true iff this instance intersects the specifed other Geometry
      • distance

        public <P extends C2D> double distance​(Geometry<P> geometry,
                                               Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Calculates the shortest distance between any two points in the two Geometrys in the coordinate reference system of this Geometry. Only the X/Y-coordinates are used in the distance calculation; M- and Z-coordinates are ignored.
        Specified by:
        distance in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry
        other - the second Geometry
        Returns:
        the shortest distance between the two specified Geometries
      • buffer

        public <P extends C2DGeometry<P> buffer​(Geometry<P> geometry,
                                                  double distance)
        Description copied from interface: ProjectedGeometryOperations
        Calculates a Geometry that represents all points whose distance from the specified Geometry is less than or equal the specified distance.

        Calculations are in the CoordinateReferenceSystem of this Geometry.

        Z- or M-coordinates are ignored in the buffering operation; and the result will always be a 2D geometry.

        Specified by:
        buffer in interface ProjectedGeometryOperations
        Parameters:
        geometry - the Geometry for which to calculate the buffer
        distance - the buffer distance
        Returns:
        a 2D Geometry representing the buffer of the specified Geometry with the specified distance.
      • intersection

        public <P extends C2DGeometry<P> intersection​(Geometry<P> geometry,
                                                        Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Calculates the point set intersection of the specified Geometrys.
        Specified by:
        intersection in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry
        other - the second Geometry
        Returns:
        a Geometry representing the point set intersection between the two specified Geometries
      • union

        public <P extends C2DGeometry<P> union​(Geometry<P> geometry,
                                                 Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Calculates the point set union of the specified Geometrys.
        Specified by:
        union in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry
        other - the second Geometry
        Returns:
        a Geometry representing the point set union between the two specified Geometries
      • difference

        public <P extends C2DGeometry<P> difference​(Geometry<P> geometry,
                                                      Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Calculates the point set difference of the specified Geometrys.
        Specified by:
        difference in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry
        other - the second Geometry
        Returns:
        a Geometry representing the point set difference between the two specified Geometries
      • symmetricDifference

        public <P extends C2DGeometry<P> symmetricDifference​(Geometry<P> geometry,
                                                               Geometry<P> other)
        Description copied from interface: ProjectedGeometryOperations
        Calculates the point set symmetric difference of the specified Geometrys.
        Specified by:
        symmetricDifference in interface ProjectedGeometryOperations
        Parameters:
        geometry - the first Geometry
        other - the second Geometry
        Returns:
        a Geometry representing the point set symmetric difference between the two specified Geometries