Partager via


st_geogfromgeojson

Important

Cette fonctionnalité est disponible en préversion publique. Vous pouvez confirmer l’inscription en préversion sur la page Aperçus . Consultez Gérer les préversions d’Azure Databricks.

Analyse la description GeoJSON et retourne la valeur Geography correspondante.

Pour la fonction SQL Databricks correspondante, consultez st_geogfromgeojson.

Syntaxe

from pyspark.databricks.sql import functions as dbf

dbf.st_geogfromgeojson(col=<col>)

Paramètres

Paramètre Type Descriptif
col pyspark.sql.Column ou str Valeur de chaîne au format GeoJSON, représentant une valeur Geography .

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))')]