Delen via


st_point

Belangrijk

Deze functie bevindt zich in openbare preview-versie.

Retourneert een 2D-puntgeometrie met de opgegeven x- en y-coördinaten en DE SRID-waarde. Als er geen SRID-waarde is opgegeven of als de opgegeven SRID-waarde negatief is, wordt de waarde van de puntgeometrie ingesteld op 0.

Zie voor de bijbehorende Databricks SQL-functie de st_point-functie.

Syntaxis

from pyspark.databricks.sql import functions as dbf

dbf.st_point(col1=<col1>, col2=<col2>, col3=<col3>)

Parameterwaarden

Kenmerk Typologie Description
col1 pyspark.sql.Column of float De X-coördinaat van de puntgeometrie.
col2 pyspark.sql.Column of float De Y-coördinaat van de puntgeometrie.
col3 pyspark.sql.Column of int, optioneel De SRID-waarde van de puntgeometrie.

Voorbeelden

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(1.0, 2.0, 4326,)], ['x', 'y', 'srid'])
df.select(dbf.st_asewkt(dbf.st_point('x', 'y', 'srid')).alias('result')).collect()
[Row(result='SRID=4326;POINT(1 2)')]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(1.0, 2.0,)], ['x', 'y'])
df.select(dbf.st_asewkt(dbf.st_point('x', 'y', 0)).alias('result')).collect()
[Row(result='POINT(1 2)')]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(1.0, 2.0, 0,)], ['x', 'y', 'srid'])
df.select(dbf.st_asewkt(dbf.st_point('x', 'y', 'srid')).alias('result')).collect()
[Row(result='POINT(1 2)')]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(1.0, 2.0,)], ['x', 'y'])
df.select(dbf.st_asewkt(dbf.st_point('x', 'y')).alias('result')).collect()
[Row(result='POINT(1 2)')]