Skip to content

Predicate

ST_Contains

Introduction: Return true if A fully contains B

Format: ST_Contains (A:geometry, B:geometry)

Since: v1.2.0

SQL example:

SELECT * 
FROM pointdf 
WHERE ST_Contains(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), pointdf.arealandmark)

ST_Disjoint

Introduction: Return true if A and B are disjoint

Format: ST_Disjoint (A:geometry, B:geometry)

Since: v1.2.1

Spark SQL example:

SELECT *
FROM pointdf 
WHERE ST_Disjoinnt(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), pointdf.arealandmark)

ST_Intersects

Introduction: Return true if A intersects B

Format: ST_Intersects (A:geometry, B:geometry)

Since: v1.2.0

SQL example:

SELECT * 
FROM pointdf 
WHERE ST_Intersects(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), pointdf.arealandmark)

ST_OrderingEquals

Introduction: Returns true if the geometries are equal and the coordinates are in the same order

Format: ST_OrderingEquals(A: geometry, B: geometry)

Since: v1.2.1

SQL example 1:

SELECT ST_OrderingEquals(ST_GeomFromWKT('POLYGON((2 0, 0 2, -2 0, 2 0))'), ST_GeomFromWKT('POLYGON((2 0, 0 2, -2 0, 2 0))'))

Output: true

SQL example 2:

SELECT ST_OrderingEquals(ST_GeomFromWKT('POLYGON((2 0, 0 2, -2 0, 2 0))'), ST_GeomFromWKT('POLYGON((0 2, -2 0, 2 0, 0 2))'))

Output: false


Last update: August 16, 2022 08:03:14