You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ji...@apache.org on 2022/06/30 19:55:52 UTC

[incubator-sedona] branch ST_Transform updated: Update the doc

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

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


The following commit(s) were added to refs/heads/ST_Transform by this push:
     new 883d33a5 Update the doc
883d33a5 is described below

commit 883d33a54b70e983c821c75427cbcdd0604cd61c
Author: Jia Yu <ji...@apache.org>
AuthorDate: Thu Jun 30 12:55:46 2022 -0700

    Update the doc
---
 docs/api/flink/Function.md | 33 ++++++++++++++++++++-------------
 docs/api/sql/Function.md   | 18 ++++++++++++------
 docs/tutorial/flink/sql.md |  2 +-
 docs/tutorial/rdd.md       |  5 +++--
 docs/tutorial/sql.md       |  2 ++
 5 files changed, 38 insertions(+), 22 deletions(-)

diff --git a/docs/api/flink/Function.md b/docs/api/flink/Function.md
index f4a0590f..c4e95ed0 100644
--- a/docs/api/flink/Function.md
+++ b/docs/api/flink/Function.md
@@ -6,7 +6,7 @@ Format: `ST_Distance (A:geometry, B:geometry)`
 
 Since: `v1.2.0`
 
-Spark SQL example:
+Flink SQL example:
 ```SQL
 SELECT ST_Distance(polygondf.countyshape, polygondf.countyshape)
 FROM polygondf
@@ -19,24 +19,30 @@ Introduction:
 Transform the Spatial Reference System / Coordinate Reference System of A, from SourceCRS to TargetCRS
 
 !!!note
-	By default, this function uses lat/lon order. You can use ==ST_FlipCoordinates== to swap X and Y.
+	By default, this function uses lon/lat order. You can use ==ST_FlipCoordinates== to swap X and Y.
 
 !!!note
-	If ==ST_Transform== throws an Exception called "Bursa wolf parameters required", you need to disable the error notification in ST_Transform. You can append a boolean value at the end.
+	If ==ST_Transform== throws an Exception called "Bursa wolf parameters required", you need to disable the error notification in ST_Transform.
 
-Format: `ST_Transform (A:geometry, SourceCRS:string, TargetCRS:string ,[Optional] DisableError)`
+Format: `ST_Transform (A:geometry, SourceCRS:string, TargetCRS:string ,[Optional] LongitudeFirst, [Optional] DisableError)`
 
 Since: `v1.2.0`
 
-Spark SQL example (simple):
+Flink SQL example (use lon/lat order and does not disable error):
 ```SQL
 SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857') 
 FROM polygondf
 ```
 
-Spark SQL example (with optional parameters):
+Flink SQL example (use lon/lat order and disable error):
 ```SQL
-SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857', false)
+SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857', true)
+FROM polygondf
+```
+
+Flink SQL example (use lat/lon order and disable error):
+```SQL
+SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857', false, true)
 FROM polygondf
 ```
 
@@ -51,7 +57,7 @@ Format: `ST_Buffer (A:geometry, buffer: Double)`
 
 Since: `v1.2.0`
 
-Spark SQL example:
+Flink SQL example:
 ```SQL
 SELECT ST_Buffer(polygondf.countyshape, 1)
 FROM polygondf
@@ -64,7 +70,7 @@ Format: `ST_Y_Min (A:geometry)`
 
 Since: `v1.2.1`
 
-Spark SQL example:
+Flink SQL example:
 ```SQL
 SELECT ST_YMin(ST_GeomFromText('POLYGON((0 0 1, 1 1 1, 1 2 1, 1 1 1, 0 0 1))'))
 ```
@@ -79,12 +85,13 @@ Format: `ST_YMax (A:geometry)`
 
 Since: `v1.2.1`
 
-Spark SQL example:
+Flink SQL example:
 ```SQL
 SELECT ST_YMax(ST_GeomFromText('POLYGON((0 0 1, 1 1 1, 1 2 1, 1 1 1, 0 0 1))'))
 ```
 
 Output : 2
+
 ## ST_FlipCoordinates
 
 Introduction: Returns a version of the given geometry with X and Y axis flipped.
@@ -93,7 +100,7 @@ Format: `ST_FlipCoordinates(A:geometry)`
 
 Since: `v1.2.0`
 
-Spark SQL example:
+Flink SQL example:
 ```SQL
 SELECT ST_FlipCoordinates(df.geometry)
 FROM df
@@ -137,7 +144,7 @@ Format: `ST_IsEmpty (A:geometry)`
 
 Since: `v1.2.1`
 
-Spark SQL example:
+Flink SQL example:
 
 ```SQL
 SELECT ST_IsEmpty(polygondf.countyshape)
@@ -274,7 +281,7 @@ Format: `ST_AsEWKT (A:geometry)`
 
 Since: `v1.2.1`
 
-Spark SQL example:
+Flink SQL example:
 ```SQL
 SELECT ST_AsEWKT(polygondf.countyshape)
 FROM polygondf
diff --git a/docs/api/sql/Function.md b/docs/api/sql/Function.md
index 2fcbc247..47ac1529 100644
--- a/docs/api/sql/Function.md
+++ b/docs/api/sql/Function.md
@@ -137,24 +137,30 @@ Introduction:
 Transform the Spatial Reference System / Coordinate Reference System of A, from SourceCRS to TargetCRS
 
 !!!note
-	By default, this function uses lat/lon order. You can use ==ST_FlipCoordinates== to swap X and Y.
+    By default, this function uses lon/lat order. You can use ==ST_FlipCoordinates== to swap X and Y.
 
 !!!note
-	If ==ST_Transform== throws an Exception called "Bursa wolf parameters required", you need to disable the error notification in ST_Transform. You can append a boolean value at the end.
+    If ==ST_Transform== throws an Exception called "Bursa wolf parameters required", you need to disable the error notification in ST_Transform.
 
-Format: `ST_Transform (A:geometry, SourceCRS:string, TargetCRS:string ,[Optional] DisableError)`
+Format: `ST_Transform (A:geometry, SourceCRS:string, TargetCRS:string ,[Optional] LongitudeFirst, [Optional] DisableError)`
 
 Since: `v1.0.0`
 
-Spark SQL example (simple):
+Spark SQL example (use lon/lat order and does not disable error):
 ```SQL
 SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857') 
 FROM polygondf
 ```
 
-Spark SQL example (with optional parameters):
+Spark SQL example (use lon/lat order and disable error):
 ```SQL
-SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857', false)
+SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857', true)
+FROM polygondf
+```
+
+Spark SQL example (use lat/lon order and disable error):
+```SQL
+SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857', false, true)
 FROM polygondf
 ```
 
diff --git a/docs/tutorial/flink/sql.md b/docs/tutorial/flink/sql.md
index bef96c8e..61f7f622 100644
--- a/docs/tutorial/flink/sql.md
+++ b/docs/tutorial/flink/sql.md
@@ -125,7 +125,7 @@ The second EPSG code EPSG:3857 in `ST_Transform` is the target CRS of the geomet
 This `ST_Transform` transform the CRS of these geomtries from EPSG:4326 to EPSG:3857. The details CRS information can be found on [EPSG.io](https://epsg.io/.)
 
 !!!note
-	Read [SedonaSQL ST_Transform API](/api/flink/Function/#st_transform) to learn different spatial query predicates.
+	Read [SedonaSQL ST_Transform API](/api/flink/Function/#st_transform) to learn more.
 
 For example, a Table that has coordinates in the US will become like this.
 
diff --git a/docs/tutorial/rdd.md b/docs/tutorial/rdd.md
index f45b3fe0..5a14eb1e 100644
--- a/docs/tutorial/rdd.md
+++ b/docs/tutorial/rdd.md
@@ -210,10 +210,11 @@ To convert Coordinate Reference System of an SpatialRDD, use the following code:
 ```Scala
 val sourceCrsCode = "epsg:4326" // WGS84, the most common degree-based CRS
 val targetCrsCode = "epsg:3857" // The most common meter-based CRS
-objectRDD.CRSTransform(sourceCrsCode, targetCrsCode, false)
+objectRDD.CRSTransform(sourceCrsCode, targetCrsCode, true, false)
 ```
 
-`false` in CRSTransform(sourceCrsCode, targetCrsCode, false) means that it will not tolerate Datum shift. If you want it to be lenient, use `true` instead.
+The `true` in CRSTransform() means that it will follow lon/lat order. If you want lat/lon order, set it to `false`.
+The `false` in CRSTransform() means that it will not tolerate Datum shift. If you want it to be lenient, use `true` instead.
 
 !!!warning
 	CRS transformation should be done right after creating each SpatialRDD, otherwise it will lead to wrong query results. For instace, use something like this:
diff --git a/docs/tutorial/sql.md b/docs/tutorial/sql.md
index 2765b9f4..2d84db99 100644
--- a/docs/tutorial/sql.md
+++ b/docs/tutorial/sql.md
@@ -172,6 +172,8 @@ The coordinates of polygons have been changed. The output will be like this:
 
 ```
 
+!!!note
+	Read [SedonaSQL ST_Transform API](/api/sql/Function/#st_transform) to learn more.
 
 ## Run spatial queries