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/08/18 22:47:42 UTC

[incubator-sedona] branch master updated: [DOCS] Document SQL functions not in the API reference (#670)

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/incubator-sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new 82ed2647 [DOCS] Document SQL functions not in the API reference (#670)
82ed2647 is described below

commit 82ed264786d80b1e26faffcb31f4b348c2759bab
Author: Kengo Seki <se...@apache.org>
AuthorDate: Fri Aug 19 07:47:36 2022 +0900

    [DOCS] Document SQL functions not in the API reference (#670)
---
 docs/api/sql/Constructor.md | 14 ++++++++++++++
 docs/api/sql/Function.md    | 44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+)

diff --git a/docs/api/sql/Constructor.md b/docs/api/sql/Constructor.md
index 27eb8180..55f55ef3 100644
--- a/docs/api/sql/Constructor.md
+++ b/docs/api/sql/Constructor.md
@@ -90,6 +90,20 @@ polygonDf.show()
 !!!warning
 	The way that SedonaSQL reads GeoJSON is different from that in SparkSQL
 
+## ST_GeomFromText
+
+Introduction: Construct a Geometry from Wkt. Alias of [ST_GeomFromWKT](#ST_GeomFromWKT)
+
+Format:
+`ST_GeomFromText (Wkt:string)`
+
+Since: `v1.0.0`
+
+Spark SQL example:
+```SQL
+SELECT ST_GeomFromText('POINT(40.7128 -74.0060)') AS geometry
+```
+
 ## ST_GeomFromWKB
 
 Introduction: Construct a Geometry from WKB string or Binary
diff --git a/docs/api/sql/Function.md b/docs/api/sql/Function.md
index 38899f37..127dadc1 100644
--- a/docs/api/sql/Function.md
+++ b/docs/api/sql/Function.md
@@ -646,6 +646,28 @@ SELECT ST_Length(polygondf.countyshape)
 FROM polygondf
 ```
 
+## ST_LineInterpolatePoint
+
+Introduction: Returns a point interpolated along a line. First argument must be a LINESTRING. Second argument is a Double between 0 and 1 representing fraction of total linestring length the point has to be located.
+
+Format: `ST_LineInterpolatePoint (geom: geometry, fraction: Double)`
+
+Since: `v1.0.1`
+
+Spark SQL example:
+```SQL
+SELECT ST_LineInterpolatePoint(ST_GeomFromWKT('LINESTRING(25 50, 100 125, 150 190)'), 0.2) as Interpolated
+```
+
+Output:
+```
++-----------------------------------------+
+|Interpolated                             |
++-----------------------------------------+
+|POINT (51.5974135047432 76.5974135047432)|
++-----------------------------------------+
+```
+
 ## ST_LineMerge
 
 Introduction: Returns a LineString formed by sewing together the constituent line work of a MULTILINESTRING.
@@ -662,6 +684,28 @@ SELECT ST_LineMerge(geometry)
 FROM df
 ```
 
+## ST_LineSubstring
+
+Introduction: Return a linestring being a substring of the input one starting and ending at the given fractions of total 2d length. Second and third arguments are Double values between 0 and 1. This only works with LINESTRINGs.
+
+Format: `ST_LineSubstring (geom: geometry, startfraction: Double, endfraction: Double)`
+
+Since: `v1.0.1`
+
+Spark SQL example:
+```SQL
+SELECT ST_LineSubstring(ST_GeomFromWKT('LINESTRING(25 50, 100 125, 150 190)'), 0.333, 0.666) as Substring
+```
+
+Output:
+```
++------------------------------------------------------------------------------------------------+
+|Substring                                                                                       |
++------------------------------------------------------------------------------------------------+
+|LINESTRING (69.28469348539744 94.28469348539744, 100 125, 111.70035626068274 140.21046313888758)|
++------------------------------------------------------------------------------------------------+
+```
+
 ## ST_MakePolygon
 
 Introduction: Function to convert closed linestring to polygon including holes