Partilhar via


st_geogfromgeojson

Importante

Este recurso está no Public Preview.

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

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

Sintaxe

from pyspark.databricks.sql import functions as dbf

dbf.st_geogfromgeojson(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 Geografia.

Examples

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