docs for h3Distance

This commit is contained in:
bharatnc 2022-05-07 23:14:08 -07:00
parent ef623a39a0
commit 2721955f49

View File

@ -1064,4 +1064,43 @@ Result:
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
## h3Distance {#h3distance}
Returns the distance in grid cells between the two indices that are provided.
**Syntax**
``` sql
h3Distance(start,end)
```
**Parameter**
- `start` — Hexagon index number that represents a starting point. Type: [UInt64](../../../sql-reference/data-types/int-uint.md).
- `end` — Hexagon index number that represents an ending point. Type: [UInt64](../../../sql-reference/data-types/int-uint.md).
**Returned value**
- Number of grid cells.
Type: [Int64](../../../sql-reference/data-types/int-uint.md).
Returns a negative number if finding the distance fails.
**Example**
Query:
``` sql
SELECT h3Distance(590080540275638271,590103561300344831) as distance;
```
Result:
``` text
┌─distance─┐
│ 7 │
└──────────┘
```
[Original article](https://clickhouse.com/docs/en/sql-reference/functions/geo/h3) <!--hide-->