This is an automated email from the ASF dual-hosted git repository.

jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new e43ed84a [DOCS] Add example outputs to all Sedona functions - 8 (#925)
e43ed84a is described below

commit e43ed84a086b9ba8fee35cae0ce49769b588b45a
Author: Furqaanahmed Khan <[email protected]>
AuthorDate: Thu Jul 27 15:57:36 2023 -0400

    [DOCS] Add example outputs to all Sedona functions - 8 (#925)
---
 docs/api/flink/Predicate.md | 127 +++++++++++++++++++++++++++++++++-----------
 docs/api/sql/Predicate.md   | 125 ++++++++++++++++++++++++++++++++-----------
 2 files changed, 188 insertions(+), 64 deletions(-)

diff --git a/docs/api/flink/Predicate.md b/docs/api/flink/Predicate.md
index 994b7cd1..5b9223fc 100644
--- a/docs/api/flink/Predicate.md
+++ b/docs/api/flink/Predicate.md
@@ -7,10 +7,15 @@ Format: `ST_Contains (A:geometry, B:geometry)`
 Since: `v1.2.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Contains(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), 
pointdf.arealandmark)
+SELECT ST_Contains(ST_GeomFromWKT('POLYGON((175 150,20 40,50 60,125 100,175 
150))'), ST_GeomFromWKT('POINT(174 149)'))
+```
+
+Output:
+
+```
+false
 ```
 
 ## ST_Crosses
@@ -22,10 +27,15 @@ Format: `ST_Crosses (A:geometry, B:geometry)`
 Since: `v1.5.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Crosses(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Crosses(ST_GeomFromWKT('POLYGON((1 1, 4 1, 4 4, 1 4, 1 
1))'),ST_GeomFromWKT('POLYGON((2 2, 5 2, 5 5, 2 5, 2 2))'))
+```
+
+Output:
+
+```
+false
 ```
 
 ## ST_Disjoint
@@ -37,10 +47,15 @@ Format: `ST_Disjoint (A:geometry, B:geometry)`
 Since: `v1.2.1`
 
 SQL example:
+
 ```sql
-SELECT *
-FROM pointdf 
-WHERE ST_Disjoinnt(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), 
pointdf.arealandmark)
+SELECT ST_Disjoint(ST_GeomFromWKT('POLYGON((1 4, 4.5 4, 4.5 2, 1 2, 1 
4))'),ST_GeomFromWKT('POLYGON((5 4, 6 4, 6 2, 5 2, 5 4))'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_Equals
@@ -52,10 +67,15 @@ Format: `ST_Equals (A:geometry, B:geometry)`
 Since: `v1.5.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Equals(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Equals(ST_GeomFromWKT('LINESTRING(0 0,10 10)'), 
ST_GeomFromWKT('LINESTRING(0 0,5 5,10 10)'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_Intersects
@@ -67,12 +87,18 @@ Format: `ST_Intersects (A:geometry, B:geometry)`
 Since: `v1.2.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Intersects(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), 
pointdf.arealandmark)
+SELECT ST_Intersects(ST_GeomFromWKT('LINESTRING(-43.23456 72.4567,-43.23456 
72.4568)'), ST_GeomFromWKT('POINT(-43.23456 72.4567772)'))
 ```
 
+Output:
+
+```
+true
+```
+
+
 ## ST_Overlaps
 
 Introduction: Return true if A overlaps B
@@ -82,12 +108,18 @@ Format: `ST_Overlaps (A:geometry, B:geometry)`
 Since: `v1.5.0`
 
 SQL example:
+
 ```sql
-SELECT *
-FROM geom
-WHERE ST_Overlaps(geom.geom_a, geom.geom_b)
+SELECT ST_Overlaps(ST_GeomFromWKT('POLYGON((2.5 2.5, 2.5 4.5, 4.5 4.5, 4.5 
2.5, 2.5 2.5))'), ST_GeomFromWKT('POLYGON((4 4, 4 6, 6 6, 6 4, 4 4))'))
+```
+
+Output:
+
+```
+true
 ```
 
+
 ## ST_Touches
 
 Introduction: Return true if A touches B
@@ -97,10 +129,15 @@ Format: `ST_Touches (A:geometry, B:geometry)`
 Since: `v1.5.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Touches(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Touches(ST_GeomFromWKT('LINESTRING(0 0,1 1,0 2)'), 
ST_GeomFromWKT('POINT(0 2)'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_Within
@@ -112,10 +149,15 @@ Format: `ST_Within (A:geometry, B:geometry)`
 Since: `v1.3.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Within(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Within(ST_GeomFromWKT('POLYGON((0 0,3 0,3 3,0 3,0 0))'), 
ST_GeomFromWKT('POLYGON((1 1,2 1,2 2,1 2,1 1))'))
+```
+
+Output:
+
+```
+false
 ```
 
 ## ST_OrderingEquals
@@ -126,18 +168,28 @@ Format: `ST_OrderingEquals(A: geometry, B: geometry)`
 Since: `v1.2.1`
 
 SQL example 1:
+
 ```sql
 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`
+Output:
+
+```
+true
+```
 
 SQL example 2:
+
 ```sql
 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`
+Output:
+
+```
+false
+```
 
 ## ST_Covers
 
@@ -148,12 +200,18 @@ Format: `ST_Covers (A:geometry, B:geometry)`
 Since: `v1.3.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Covers(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), 
pointdf.arealandmark)
+SELECT ST_Covers(ST_GeomFromWKT('POLYGON((-2 0,0 2,2 0,-2 0))'), 
ST_GeomFromWKT('POLYGON((-1 0,0 1,1 0,-1 0))'))
 ```
 
+Output:
+
+```
+true
+```
+
+
 ## ST_CoveredBy
 
 Introduction: Return true if A is covered by B
@@ -163,8 +221,13 @@ Format: `ST_CoveredBy (A:geometry, B:geometry)`
 Since: `v1.3.0`
 
 SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_CoveredBy(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_CoveredBy(ST_GeomFromWKT('POLYGON((0 0,3 0,3 3,0 3,0 0))'),  
ST_GeomFromWKT('POLYGON((1 1,2 1,2 2,1 2,1 1))'))
+```
+
+Output:
+
+```
+false
 ```
diff --git a/docs/api/sql/Predicate.md b/docs/api/sql/Predicate.md
index 4e4b9c3c..d2a42de6 100644
--- a/docs/api/sql/Predicate.md
+++ b/docs/api/sql/Predicate.md
@@ -7,10 +7,15 @@ Format: `ST_Contains (A:geometry, B:geometry)`
 Since: `v1.0.0`
 
 Spark SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Contains(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), 
pointdf.arealandmark)
+SELECT ST_Contains(ST_GeomFromWKT('POLYGON((175 150,20 40,50 60,125 100,175 
150))'), ST_GeomFromWKT('POINT(174 149)'))
+```
+
+Output:
+
+```
+false
 ```
 
 ## ST_Crosses
@@ -22,10 +27,15 @@ Format: `ST_Crosses (A:geometry, B:geometry)`
 Since: `v1.0.0`
 
 Spark SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Crosses(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Crosses(ST_GeomFromWKT('POLYGON((1 1, 4 1, 4 4, 1 4, 1 
1))'),ST_GeomFromWKT('POLYGON((2 2, 5 2, 5 5, 2 5, 2 2))'))
+```
+
+Output:
+
+```
+false
 ```
 
 ## ST_Disjoint
@@ -37,10 +47,15 @@ Format: `ST_Disjoint (A:geometry, B:geometry)`
 Since: `v1.2.1`
 
 Spark SQL example:
+
 ```sql
-SELECT *
-FROM geom
-WHERE ST_Disjoinnt(geom.geom_a, geom.geom_b)
+SELECT ST_Disjoint(ST_GeomFromWKT('POLYGON((1 4, 4.5 4, 4.5 2, 1 2, 1 
4))'),ST_GeomFromWKT('POLYGON((5 4, 6 4, 6 2, 5 2, 5 4))'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_Equals
@@ -52,10 +67,15 @@ Format: `ST_Equals (A:geometry, B:geometry)`
 Since: `v1.0.0`
 
 Spark SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Equals(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Equals(ST_GeomFromWKT('LINESTRING(0 0,10 10)'), 
ST_GeomFromWKT('LINESTRING(0 0,5 5,10 10)'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_Intersects
@@ -67,10 +87,15 @@ Format: `ST_Intersects (A:geometry, B:geometry)`
 Since: `v1.0.0`
 
 Spark SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Intersects(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), 
pointdf.arealandmark)
+SELECT ST_Intersects(ST_GeomFromWKT('LINESTRING(-43.23456 72.4567,-43.23456 
72.4568)'), ST_GeomFromWKT('POINT(-43.23456 72.4567772)'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_OrderingEquals
@@ -81,18 +106,28 @@ Format: `ST_OrderingEquals(A: geometry, B: geometry)`
 Since: `v1.2.1`
 
 Spark SQL example 1:
+
 ```sql
 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`
+Output: 
+
+```
+true
+```
 
 Spark SQL example 2:
+
 ```sql
 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`
+Output: 
+
+```
+false
+```
 
 ## ST_Overlaps
 
@@ -103,10 +138,15 @@ Format: `ST_Overlaps (A:geometry, B:geometry)`
 Since: `v1.0.0`
 
 Spark SQL example:
+
 ```sql
-SELECT *
-FROM geom
-WHERE ST_Overlaps(geom.geom_a, geom.geom_b)
+SELECT ST_Overlaps(ST_GeomFromWKT('POLYGON((2.5 2.5, 2.5 4.5, 4.5 4.5, 4.5 
2.5, 2.5 2.5))'), ST_GeomFromWKT('POLYGON((4 4, 4 6, 6 6, 6 4, 4 4))'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_Touches
@@ -117,10 +157,16 @@ Format: `ST_Touches (A:geometry, B:geometry)`
 
 Since: `v1.0.0`
 
+Example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Touches(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Touches(ST_GeomFromWKT('LINESTRING(0 0,1 1,0 2)'), 
ST_GeomFromWKT('POINT(0 2)'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_Within
@@ -132,10 +178,15 @@ Format: `ST_Within (A:geometry, B:geometry)`
 Since: `v1.0.0`
 
 Spark SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Within(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_Within(ST_GeomFromWKT('POLYGON((0 0,3 0,3 3,0 3,0 0))'), 
ST_GeomFromWKT('POLYGON((1 1,2 1,2 2,1 2,1 1))'))
+```
+
+Output:
+
+```
+false
 ```
 
 ## ST_Covers
@@ -147,10 +198,15 @@ Format: `ST_Covers (A:geometry, B:geometry)`
 Since: `v1.3.0`
 
 Spark SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_Covers(ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0), 
pointdf.arealandmark)
+SELECT ST_Covers(ST_GeomFromWKT('POLYGON((-2 0,0 2,2 0,-2 0))'), 
ST_GeomFromWKT('POLYGON((-1 0,0 1,1 0,-1 0))'))
+```
+
+Output:
+
+```
+true
 ```
 
 ## ST_CoveredBy
@@ -162,8 +218,13 @@ Format: `ST_CoveredBy (A:geometry, B:geometry)`
 Since: `v1.3.0`
 
 Spark SQL example:
+
 ```sql
-SELECT * 
-FROM pointdf 
-WHERE ST_CoveredBy(pointdf.arealandmark, 
ST_PolygonFromEnvelope(1.0,100.0,1000.0,1100.0))
+SELECT ST_CoveredBy(ST_GeomFromWKT('POLYGON((0 0,3 0,3 3,0 3,0 0))'),  
ST_GeomFromWKT('POLYGON((1 1,2 1,2 2,1 2,1 1))'))
+```
+
+Output:
+
 ```
+false
+```
\ No newline at end of file

Reply via email to