st_geohash
Renvoie le géohash de la géométrie d'entrée.
Pour la fonction Databricks SQL correspondante, consultez la fonctionst_geohash.
Syntaxe
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_geohash(col1=<col1>, col2=<col2>)
parameter
parameter | Type | Description |
|---|---|---|
|
| Une valeur de géométrie. |
|
| La précision facultative (nombre de chiffres significatifs) du géohash de sortie. Doit être non négatif. |
Exemples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT(-122.4261475 37.77374268)',)], ['wkt'])
df.select(dbf.st_geohash(dbf.st_geomfromtext('wkt')).alias('result')).collect()
Output
[Row(result='9q8yyhebpbpb')]
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT(-122.4261475 37.77374268)',)], ['wkt'])
df.select(dbf.st_geohash(dbf.st_geomfromtext('wkt'), 6).alias('result')).collect()
Output
[Row(result='9q8yyh')]