---
title: h3_longlatash3string function
description: Learn the syntax of the h3\_longlatash3string function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/h3_longlatash3string
---

# `h3_longlatash3string` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime 11.3 LTS and above ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Lakehouse//RT

Returns the H3 cell ID (as a hexadecimal STRING) corresponding to the provided longitude and latitude at the specified resolution.

## Syntax

```
h3_longlatash3string ( longitudeExpr, latitudeExpr, resolutionExpr )
```

## Arguments

* `longitudeExpr`: A `DOUBLE` expression representing the longitude (in degrees) of the location whose H3 cell ID we want to compute.
* `latitudeExpr`: A `DOUBLE` expression representing the latitude (in degrees) of the location whose H3 cell ID we want to compute.
* `resolutionExpr`: An `INT` expression, whose value is expected to be between 0 and 15 inclusive, specifying the resolution for the H3 cell ID.

## Returns

A value of the type of `STRING` representing, as a hexadecimal string, the H3 cell ID of the input location at the specified resolution.

The function returns `NULL` if any of the three input expressions is `NULL`.
Values outside `[-180, 180]` for the longitude expression, and `[-90, 90]` for the latitude expression are mapped to their equivalents within these ranges.
The longitude and latitude values are expected to be in the WGS84 coordinate reference system.

## Error conditions

* If `resolutionExpr` is smaller than `0` or larger than `15`, the function returns [H3\_INVALID\_RESOLUTION\_VALUE](https://docs.databricks.com/aws/en/error-messages/h3-invalid-resolution-value-error-class.md).

## Examples

```sql
-- Simple example.
> SELECT h3_longlatash3string(100, 45, 6);
  86240610fffffff

-- The H3 cell ID for the Golden Gate Bridge at resolution 13.
> SELECT h3_longlatash3string(-122.4783, 37.8199, 13);
  8d283087022a93f

-- Resolution is out of range.
> SELECT h3_longlatash3string(-122.4783, 37.8199, 16);
  [H3_INVALID_RESOLUTION_VALUE] H3 resolution 16 must be between 0 and 15, inclusive
```

## Related functions

* [`h3_longlatash3` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/h3_longlatash3.md)
* [`h3_pointash3` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/h3_pointash3.md)
* [`h3_pointash3string` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/h3_pointash3string.md)
