

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# ST\$1GeomFromGeoHash
<a name="ST_GeomFromGeoHash-function"></a>

ST\$1GeomFromGeoHash constructs a geometry object from the geohash representation of an input geometry. ST\$1GeomFromGeoHash returns a two-dimensional (2D) geometry with the spatial reference identifier (SRID) of zero (0). For more information about the geohash format, see [Geohash](https://en.wikipedia.org/wiki/Geohash) in Wikipedia. 

## Syntax
<a name="ST_GeomFromGeoHash-function-syntax"></a>

```
ST_GeomFromGeoHash(geohash_string)
```

```
ST_GeomFromGeoHash(geohash_string, precision)
```

## Arguments
<a name="ST_GeomFromGeoHash-function-arguments"></a>

 *geohash\$1string*   
A value of data type `VARCHAR` or an expression that evaluates to a `VARCHAR` type, that is a geohash representation of a geometry.

 *precision*   
A value of data type `INTEGER` that represents the precision of the geohash. The value is the number of characters of the geohash to be used as precision. If the value is not specified, less than zero, or greater than the *geohash\$1string* length. then the *geohash\$1string* length is used.

## Return type
<a name="ST_GeomFromGeoHash-function-return"></a>

`GEOMETRY`

If *geohash\$1string* is null, then null is returned. 

If *geohash\$1string* is not valid, then an error is returned. 

## Examples
<a name="ST_GeomFromGeoHash-function-examples"></a>

The following SQL returns a polygon with high precision. 

```
SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz0'));
```

```
 st_asewkt       
-----------------------
 POLYGON((-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646))
```

The following SQL returns a point with high precision. 

```
SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz00'));
```

```
 st_asewkt       
-----------------------
 POINT(-115.172816 36.114646)
```

The following SQL returns a polygon with low precision. 

```
SELECT ST_AsText(ST_GeomFromGeoHash('9qq'));
```

```
 st_asewkt       
-----------------------
 POLYGON((-115.3125 35.15625,-115.3125 36.5625,-113.90625 36.5625,-113.90625 35.15625,-115.3125 35.15625))
```

The following SQL returns a polygon with precision 3. 

```
SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz0', 3));
```

```
 st_asewkt       
-----------------------
 POLYGON((-115.3125 35.15625,-115.3125 36.5625,-113.90625 36.5625,-113.90625 35.15625,-115.3125 35.15625))
```