Skip to main content

st_geomfromgeohash

Preview

This feature is in Public Preview.

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

Python
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

Python
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()
Output
[Row(result='POLYGON((-122.431640625 37.77099609375,-122.431640625 37.7764892578125,-122.420654296875 37.7764892578125,-122.420654296875 37.77099609375,-122.431640625 37.77099609375))')]