Class JTSSpatialPredicates

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected JTSSpatialPredicates()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Predicate contains​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially contains" constraint.
      static Predicate contains​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially contains" constraint.
      static Predicate crosses​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially crosses" constraint.
      static Predicate crosses​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially crosses" constraint.
      static Predicate disjoint​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially disjoint" constraint.
      static Predicate disjoint​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially disjoint" constraint.
      static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2, double distance)
      Create a predicate for testing the arguments for "distance within" constraint.
      static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2, Expression<java.lang.Double> distance)
      Create a predicate for testing the arguments for "distance within" constraint.
      static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2, double distance)
      Create a predicate for testing the arguments for "distance within" constraint.
      static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2, Expression<java.lang.Double> distance)
      Create a predicate for testing the arguments for "distance within" constraint.
      static Predicate eq​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially equal" constraint.
      static Predicate eq​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially equal" constraint.
      static Predicate filter​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for bounding box overlap constraint.
      static Predicate filter​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for bounding box overlap constraint.
      static Predicate filterByPolygon​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry, org.locationtech.jts.geom.Envelope envelope, int srid)
      Create a predicate for testing the arguments for bounding box overlap constraint.
      static Predicate havingSRID​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry, int srid)
      Create a predicate for testing the arguments for "having srid" constraint.
      static Predicate havingSRID​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry, Expression<java.lang.Integer> srid)
      Create a predicate for testing the arguments for "having srid" constraint.
      static Predicate intersects​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially intersects" constraint.
      static Predicate intersects​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially intersects" constraint.
      static Predicate isEmpty​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry)
      Create a predicate for testing the arguments for "is empty" constraint.
      static Predicate isNotEmpty​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry)
      Create a predicate for testing the arguments for "is not empty" constraint.
      static Predicate overlaps​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially overlaps" constraint.
      static Predicate overlaps​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially overlaps" constraint.
      static Predicate touches​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially touches" constraint.
      static Predicate touches​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially touches" constraint.
      static Predicate within​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
      Create a predicate for testing the arguments for "spatially within" constraint.
      static Predicate within​(CriteriaBuilder criteriaBuilder, Expression<? extends org.locationtech.jts.geom.Geometry> geometry1, org.locationtech.jts.geom.Geometry geometry2)
      Create a predicate for testing the arguments for "spatially within" constraint.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JTSSpatialPredicates

        protected JTSSpatialPredicates()
    • Method Detail

      • eq

        public static Predicate eq​(CriteriaBuilder criteriaBuilder,
                                   Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                   Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially equal" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially equal" predicate
        See Also:
        SpatialRestrictions.eq(String, Geometry)
      • eq

        public static Predicate eq​(CriteriaBuilder criteriaBuilder,
                                   Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                   org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially equal" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially equal" predicate
        See Also:
        eq(CriteriaBuilder, Expression, Expression)
      • within

        public static Predicate within​(CriteriaBuilder criteriaBuilder,
                                       Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                       Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially within" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially within" predicate
        See Also:
        SpatialRestrictions.within(String, Geometry)
      • within

        public static Predicate within​(CriteriaBuilder criteriaBuilder,
                                       Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                       org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially within" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially within" predicate
        See Also:
        within(CriteriaBuilder, Expression, Expression)
      • contains

        public static Predicate contains​(CriteriaBuilder criteriaBuilder,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially contains" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially contains" predicate
        See Also:
        SpatialRestrictions.contains(String, Geometry)
      • contains

        public static Predicate contains​(CriteriaBuilder criteriaBuilder,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                         org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially contains" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially contains" predicate
        See Also:
        contains(CriteriaBuilder, Expression, Expression)
      • crosses

        public static Predicate crosses​(CriteriaBuilder criteriaBuilder,
                                        Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                        Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially crosses" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially crosses" predicate
        See Also:
        SpatialRestrictions.crosses(String, Geometry)
      • crosses

        public static Predicate crosses​(CriteriaBuilder criteriaBuilder,
                                        Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                        org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially crosses" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially crosses" predicate
        See Also:
        crosses(CriteriaBuilder, Expression, Expression)
      • disjoint

        public static Predicate disjoint​(CriteriaBuilder criteriaBuilder,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially disjoint" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially disjoint" predicate
        See Also:
        SpatialRestrictions.disjoint(String, Geometry)
      • disjoint

        public static Predicate disjoint​(CriteriaBuilder criteriaBuilder,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                         org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially disjoint" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially disjoint" predicate
        See Also:
        disjoint(CriteriaBuilder, Expression, Expression)
      • intersects

        public static Predicate intersects​(CriteriaBuilder criteriaBuilder,
                                           Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                           Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially intersects" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially intersects" predicate
        See Also:
        SpatialRestrictions.intersects(String, Geometry)
      • intersects

        public static Predicate intersects​(CriteriaBuilder criteriaBuilder,
                                           Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                           org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially intersects" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially intersects" predicate
        See Also:
        intersects(CriteriaBuilder, Expression, Expression)
      • overlaps

        public static Predicate overlaps​(CriteriaBuilder criteriaBuilder,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially overlaps" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially overlaps" predicate
        See Also:
        SpatialRestrictions.overlaps(String, Geometry)
      • overlaps

        public static Predicate overlaps​(CriteriaBuilder criteriaBuilder,
                                         Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                         org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially overlaps" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially overlaps" predicate
        See Also:
        overlaps(CriteriaBuilder, Expression, Expression)
      • touches

        public static Predicate touches​(CriteriaBuilder criteriaBuilder,
                                        Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                        Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for "spatially touches" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        Returns:
        "spatially touches" predicate
        See Also:
        SpatialRestrictions.touches(String, Geometry)
      • touches

        public static Predicate touches​(CriteriaBuilder criteriaBuilder,
                                        Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                        org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for "spatially touches" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        Returns:
        "spatially touches" predicate
        See Also:
        touches(CriteriaBuilder, Expression, Expression)
      • filter

        public static Predicate filter​(CriteriaBuilder criteriaBuilder,
                                       Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                       Expression<? extends org.locationtech.jts.geom.Geometry> geometry2)
        Create a predicate for testing the arguments for bounding box overlap constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression whose bounding box to use in the comparison
        Returns:
        bounding box overlap predicate
        See Also:
        JTSFilterPredicate, SpatialRestrictions.filter(String, Geometry)
      • filter

        public static Predicate filter​(CriteriaBuilder criteriaBuilder,
                                       Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                       org.locationtech.jts.geom.Geometry geometry2)
        Create a predicate for testing the arguments for bounding box overlap constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value whose bounding box to use in the comparison
        Returns:
        bounding box overlap predicate
        See Also:
        JTSFilterPredicate, SpatialRestrictions.filter(String, Geometry)
      • filterByPolygon

        public static Predicate filterByPolygon​(CriteriaBuilder criteriaBuilder,
                                                Expression<? extends org.locationtech.jts.geom.Geometry> geometry,
                                                org.locationtech.jts.geom.Envelope envelope,
                                                int srid)
        Create a predicate for testing the arguments for bounding box overlap constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry - geometry expression
        envelope - envelope or bounding box to use in the comparison
        srid - the SRID of the bounding box
        Returns:
        bounding box overlap predicate
        See Also:
        JTSFilterPredicate, SpatialRestrictions.filter(String, Envelope, int)
      • distanceWithin

        public static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder,
                                               Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                               Expression<? extends org.locationtech.jts.geom.Geometry> geometry2,
                                               Expression<java.lang.Double> distance)
        Create a predicate for testing the arguments for "distance within" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        distance - distance expression
        Returns:
        "distance within" predicate
        See Also:
        SpatialRestrictions.distanceWithin(String, Geometry, double)
      • distanceWithin

        public static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder,
                                               Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                               org.locationtech.jts.geom.Geometry geometry2,
                                               Expression<java.lang.Double> distance)
        Create a predicate for testing the arguments for "distance within" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        distance - distance expression
        Returns:
        "distance within" predicate
        See Also:
        distanceWithin(CriteriaBuilder, Expression, Expression, Expression)
      • distanceWithin

        public static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder,
                                               Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                               org.locationtech.jts.geom.Geometry geometry2,
                                               double distance)
        Create a predicate for testing the arguments for "distance within" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry value
        distance - distance value
        Returns:
        "distance within" predicate
        See Also:
        distanceWithin(CriteriaBuilder, Expression, Expression, Expression)
      • distanceWithin

        public static Predicate distanceWithin​(CriteriaBuilder criteriaBuilder,
                                               Expression<? extends org.locationtech.jts.geom.Geometry> geometry1,
                                               Expression<? extends org.locationtech.jts.geom.Geometry> geometry2,
                                               double distance)
        Create a predicate for testing the arguments for "distance within" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry1 - geometry expression
        geometry2 - geometry expression
        distance - distance value
        Returns:
        "distance within" predicate
        See Also:
        distanceWithin(CriteriaBuilder, Expression, Expression, Expression)
      • havingSRID

        public static Predicate havingSRID​(CriteriaBuilder criteriaBuilder,
                                           Expression<? extends org.locationtech.jts.geom.Geometry> geometry,
                                           Expression<java.lang.Integer> srid)
        Create a predicate for testing the arguments for "having srid" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry - geometry expression
        srid - SRID expression
        Returns:
        "having srid" predicate
        See Also:
        SpatialRestrictions.havingSRID(String, int)
      • havingSRID

        public static Predicate havingSRID​(CriteriaBuilder criteriaBuilder,
                                           Expression<? extends org.locationtech.jts.geom.Geometry> geometry,
                                           int srid)
        Create a predicate for testing the arguments for "having srid" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry - geometry expression
        srid - SRID expression
        Returns:
        "having srid" predicate
        See Also:
        havingSRID(CriteriaBuilder, Expression, Expression)
      • isEmpty

        public static Predicate isEmpty​(CriteriaBuilder criteriaBuilder,
                                        Expression<? extends org.locationtech.jts.geom.Geometry> geometry)
        Create a predicate for testing the arguments for "is empty" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry - geometry expression
        Returns:
        "is empty" predicate
        See Also:
        SpatialRestrictions.isEmpty(String)
      • isNotEmpty

        public static Predicate isNotEmpty​(CriteriaBuilder criteriaBuilder,
                                           Expression<? extends org.locationtech.jts.geom.Geometry> geometry)
        Create a predicate for testing the arguments for "is not empty" constraint.
        Parameters:
        criteriaBuilder - CriteriaBuilder
        geometry - geometry expression
        Returns:
        "is not empty" predicate
        See Also:
        SpatialRestrictions.isNotEmpty(String)