Partilhar via


st_geomfromgeojson

Importante

Este recurso está no Public Preview.

Analisa a descrição GeoJSON e devolve o valor correspondente de Geometria .

Para a função SQL do Databricks correspondente, veja st_geomfromgeojson função.

Sintaxe

from pyspark.databricks.sql import functions as dbf

dbf.st_geomfromgeojson(col=<col>)

Parâmetros

Parâmetro Tipo Description
col pyspark.sql.Column ou str Um valor de string em formato GeoJSON, representando um valor de Geometria.

Examples

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('{"type":"LineString","coordinates":[[5,6],[7,-8]]}',)], ['geojson'])
df.select(dbf.st_asewkt(dbf.st_geomfromgeojson('geojson')).alias('result')).collect()
[Row(result='SRID=4326;LINESTRING(5 6,7 -8)')]