ST_EndPoint

ST_EndPoint takes a linestring column and returns a point column. The point column represents the last point of the input linestring.

FunctionSyntax
Pythonend_point(linestring)
SQLST_EndPoint(linestring)
ScalaendPoint(linestring)

For more details, go to the GeoAnalytics Engine API reference for end_point.

This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1.

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
from geoanalytics.sql import functions as ST, Linestring

df = spark.createDataFrame([(Linestring([[[5,5],[7,6],[6,6],[4,2]]]),)], ["linestring"])

df.select(ST.end_point("linestring").alias("end_point")).show()
Result
Use dark colors for code blocksCopy
1
2
3
4
5
+-------------+
|    end_point|
+-------------+
|{"x":4,"y":2}|
+-------------+

Version table

ReleaseNotes

1.0.0

Python and SQL functions introduced

1.5.0

Scala function introduced

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.