Skip to content

Commit

Permalink
inspection.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfriend committed Oct 26, 2024
1 parent 5028908 commit e068b5e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 19 deletions.
1 change: 1 addition & 0 deletions website/docs/api/indexing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ h3.cell_to_boundary(cell)
```

Returns tuple of lat/lng tuples.
For GeoJSON compatibility, see the [`h3-py` docs](https://uber.github.io/h3-py/api_quick.html#polygon-interface).

</TabItem>
<TabItem value="shell">
Expand Down
73 changes: 54 additions & 19 deletions website/docs/api/inspection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ These functions provide metadata about an H3 index, such as its resolution or ba

## getResolution

Returns the resolution of the index.
(Works for cells, edges, and vertexes.)

<Tabs
groupId="language"
defaultValue="c"
Expand Down Expand Up @@ -79,10 +82,12 @@ $ h3 getResolution -c 85283473fffffff
</TabItem>
</Tabs>

Returns the resolution of the index.

## getBaseCellNumber

Returns the base cell number of the index.
(Works for cells, edges, and vertexes.)

<Tabs
groupId="language"
defaultValue="c"
Expand Down Expand Up @@ -150,10 +155,10 @@ $ h3 getBaseCellNumber -c 85283473fffffff
</TabItem>
</Tabs>

Returns the base cell number of the index.

## stringToH3

Converts the string representation to `H3Index` (`uint64_t`) representation.

<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -171,6 +176,8 @@ Returns the base cell number of the index.
H3Error stringToH3(const char *str, H3Index *out);
```
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand All @@ -181,8 +188,12 @@ long stringToH3(String h3Address);
</TabItem>
<TabItem value="javascript">

:::note

The H3 JavaScript binding supports only the string representation of an H3 index.

:::

</TabItem>
<TabItem value="python">

Expand All @@ -193,16 +204,20 @@ h3.string_to_h3(h)
</TabItem>
<TabItem value="shell">

:::note

The H3 CLI supports only the string representation of an H3 index.

:::


</TabItem>
</Tabs>

Converts the string representation to `H3Index` (`uint64_t`) representation.
## h3ToString

Returns 0 (`E_SUCCESS`) on success.
Converts the `H3Index` representation of the index to the string representation. `str` must be at least of length 17.

## h3ToString

<Tabs
groupId="language"
Expand All @@ -221,13 +236,24 @@ Returns 0 (`E_SUCCESS`) on success.
H3Error h3ToString(H3Index h, char *str, size_t sz);
```
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
```java
String h3ToString(long h3);
```

</TabItem>
<TabItem value="javascript">

:::note

The H3 JavaScript binding supports only the string representation of an H3 index.

:::

</TabItem>
<TabItem value="python">

Expand All @@ -238,17 +264,21 @@ h3.h3_to_string(h)
</TabItem>
<TabItem value="shell">

:::note

The H3 CLI supports only the string representation of an H3 index.

:::

</TabItem>
</Tabs>

Converts the `H3Index` representation of the index to the string representation. `str` must be at least of length 17.

Returns 0 (`E_SUCCESS`) on success.

## isValidCell

Returns non-zero if this is a valid H3 cell index.

<Tabs
groupId="language"
defaultValue="c"
Expand Down Expand Up @@ -317,10 +347,11 @@ true
</TabItem>
</Tabs>
Returns non-zero if this is a valid H3 cell index.
## isResClassIII
Returns non-zero if this index has a resolution with Class III orientation.
<Tabs
groupId="language"
defaultValue="c"
Expand Down Expand Up @@ -389,10 +420,11 @@ true
</TabItem>
</Tabs>
Returns non-zero if this index has a resolution with Class III orientation.
## isPentagon
Returns non-zero if this index represents a pentagonal cell.
<Tabs
groupId="language"
defaultValue="c"
Expand Down Expand Up @@ -461,10 +493,12 @@ false
</TabItem>
</Tabs>
Returns non-zero if this index represents a pentagonal cell.
## getIcosahedronFaces
Find all icosahedron faces intersected by a given H3 cell.
Faces are represented as integers from 0-19, inclusive.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -482,6 +516,11 @@ Returns non-zero if this index represents a pentagonal cell.
H3Error getIcosahedronFaces(H3Index h, int* out);
```
Face values and places them in the array `out`. `out` must be at least length of `maxFaceCount(h)`.
The array is sparse, and empty (no intersection) array values are represented by -1.
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -532,14 +571,10 @@ $ h3 getIcosahedronFaces -c 85283473fffffff
</TabItem>
</Tabs>
Find all icosahedron faces intersected by a given H3 index and places them in the array `out`. `out` must be at least length of `maxFaceCount(h)`.
Faces are represented as integers from 0-19, inclusive. The array is sparse, and empty (no intersection) array values are represented by -1.
Returns 0 (`E_SUCCESS`) on success.
## maxFaceCount
Returns the maximum number of icosahedron faces the given H3 index may intersect.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -557,6 +592,8 @@ Returns 0 (`E_SUCCESS`) on success.
H3Error maxFaceCount(H3Index h3, int *out);
```
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -595,5 +632,3 @@ This function exists for memory management and is not exposed.
</TabItem>
</Tabs>
Returns the maximum number of icosahedron faces the given H3 index may intersect.

0 comments on commit e068b5e

Please sign in to comment.