Class GeoPredicates

java.lang.Object
org.apache.tinkerpop.gremlin.structure.geo.GeoPredicates

public final class GeoPredicates extends Object
Evaluates the geometry predicates with JTS.

A value that cannot be compared gives false: a non-geometry, null, an empty geometry, a different SRID, or a model other than Model.CARTESIAN or Model.GEOGRAPHIC.

All math is 2D. Model.GEOGRAPHIC relates shapes in longitude and latitude, with edges straight in both, so the predicates hold for edges under about 100 km that cross neither the antimeridian nor a pole.

Operands are converted to JTS on every call and nothing is cached, because JTS geometries are not thread safe and one predicate may be shared by many traversers.

Since:
4.0.0
  • Method Details

    • within

      public static boolean within(Object value, Object argument)
      Returns true if value lies entirely inside argument. A value that lies only on the argument's boundary is not within it.
      Since:
      4.0.0
    • contains

      public static boolean contains(Object value, Object argument)
      Returns true if value entirely contains argument. A geometry does not contain a value that lies only on its boundary.
      Since:
      4.0.0