Share via


st_geomfromgeohash

Important

This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Azure Databricks previews.

Returns the geohash grid box corresponding to the input geohash value as a 2D polygon geometry.

For the corresponding Databricks SQL function, see st_geomfromgeohash function.

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.st_geomfromgeohash(col=<col>)

Parameters

Parameter Type Description
col pyspark.sql.Column or str A string value representing a geohash value.

Examples

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('9q8yyh',)], ['geohash'])
df.select(dbf.st_astext(dbf.st_geomfromgeohash('geohash')).alias('result')).collect()
[Row(result='POLYGON((-122.431640625 37.77099609375,-122.431640625 37.7764892578125,-122.420654296875 37.7764892578125,-122.420654296875 37.77099609375,-122.431640625 37.77099609375))')]