Freigeben über


h3_boundaryasgeojson

Gibt die Grenze einer H3-Zelle im GeoJSON-Format zurück. Unterstützt Spark Connect.

Die entsprechende Databricks SQL-Funktion finden Sie unter h3_boundaryasgeojson Funktion.

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.h3_boundaryasgeojson(col=<col>)

Die Parameter

Parameter Typ Description
col pyspark.sql.Column oder str Eine H3-Zell-ID, dargestellt als Spalte oder Zeichenfolge.

Examples

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(599686042433355775,),], ['h3l'])
df.select(dbf.h3_boundaryasgeojson('h3l').alias('result')).collect()
[Row(result='{"type":"Polygon","coordinates":[[[-121.915080327,37.271355867],[-121.862223289,37.353926451],[-121.923549996,37.428341186],[-122.037734964,37.420128678],[-122.090428929,37.337556084],[-122.029101309,37.263197975],[-121.915080327,37.271355867]]]}')]