Skip to content

Commit

Permalink
Update docs to match h3-py v4.x (#938)
Browse files Browse the repository at this point in the history
* Update docs to match h3-py v4.x

* separate descriptions by language

* C that?

* move all general stuff up top

* latlngtocell

* cellToLatLng questions

* chill

* cellToBoundary

* inspection.mdx

* merp

* reordering

* gridDisk

* a few more

* traversal.mdx

* hierarchy

* directededge.mdx

* vertex.mdx

* misc.mdx

* revealing too much

* explicit returns

* more Returns 0 (`E_SUCCESS`) on success.

* spacing

* spacing

* Fix return types for cellToChildPos and childPosToCell

* fmistad

* David's comments

* typo!
  • Loading branch information
ajfriend authored Oct 27, 2024
1 parent 3468085 commit f0d6cd4
Show file tree
Hide file tree
Showing 8 changed files with 655 additions and 447 deletions.
68 changes: 44 additions & 24 deletions website/docs/api/directededge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ edge from one cell to a neighboring cell.

## areNeighborCells

Determines whether or not the provided H3 cells are neighbors.

<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -30,6 +32,10 @@ edge from one cell to a neighboring cell.
H3Error areNeighborCells(H3Index origin, H3Index destination, int *out);
```
`out` will be 1 if the indexes are neighbors, 0 otherwise.
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -83,12 +89,12 @@ true
</TabItem>
</Tabs>
Returns whether or not the provided H3 cell indexes are neighbors.
`out` will be 1 if the indexes are neighbors, 0 otherwise.
## cellsToDirectedEdge
Provides a directed edge H3 index based on the provided origin and
destination.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -106,6 +112,8 @@ Returns whether or not the provided H3 cell indexes are neighbors.
H3Error cellsToDirectedEdge(H3Index origin, H3Index destination, H3Index *out);
```
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -159,13 +167,10 @@ $ h3 cellsToDirectedEdge -o 85283473fffffff -d 85283477fffffff
</TabItem>
</Tabs>
Returns a unidirectional edge H3 index based on the provided origin and
destination.
Returns 0 on success.
## isValidDirectedEdge
Determines if the provided H3Index is a valid unidirectional edge index.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -183,6 +188,8 @@ Returns 0 on success.
int isValidDirectedEdge(H3Index edge);
```
Returns `1` if it is a unidirectional edge H3Index, otherwise `0`.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -234,12 +241,10 @@ true
</TabItem>
</Tabs>
Determines if the provided H3Index is a valid unidirectional edge index.
Returns 1 if it is a unidirectional edge H3Index, otherwise 0.
## getDirectedEdgeOrigin
Provides the origin hexagon from the directed edge H3Index.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -257,6 +262,8 @@ Returns 1 if it is a unidirectional edge H3Index, otherwise 0.
H3Error getDirectedEdgeOrigin(H3Index edge, H3Index *out);
```
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -308,10 +315,10 @@ $ h3 getDirectedEdgeOrigin -c 115283473fffffff
</TabItem>
</Tabs>
Returns the origin hexagon from the unidirectional edge H3Index.
## getDirectedEdgeDestination
Provides the destination hexagon from the directed edge H3Index.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -329,6 +336,8 @@ Returns the origin hexagon from the unidirectional edge H3Index.
H3Error getDirectedEdgeDestination(H3Index edge, H3Index *out);
```
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -380,10 +389,11 @@ $ h3 getDirectedEdgeDestination -c 115283473fffffff
</TabItem>
</Tabs>
Returns the destination hexagon from the unidirectional edge H3Index.
## directedEdgeToCells
Provides the origin-destination pair of cells for the given directed edge.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -401,6 +411,11 @@ Returns the destination hexagon from the unidirectional edge H3Index.
H3Error directedEdgeToCells(H3Index edge, H3Index* originDestination);
```
The origin and destination are placed at
`originDestination[0]` and `originDestination[1]`, respectively.
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -452,11 +467,10 @@ $ h3 directedEdgeToCells -c 115283473fffffff
</TabItem>
</Tabs>
Returns the origin, destination pair of hexagon IDs for the given edge ID, which are placed at `originDestination[0]` and
`originDestination[1]` respectively.
## originToDirectedEdges
Provides all of the directed edges from the current cell.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -474,6 +488,12 @@ Returns the origin, destination pair of hexagon IDs for the given edge ID, which
H3Error originToDirectedEdges(H3Index origin, H3Index* edges);
```
`edges` must be of length 6,
and the number of directed edges placed in the array may be less than 6.
If this is the case, one of the members of the array will be `0`.
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand Down Expand Up @@ -525,12 +545,12 @@ $ h3 originToDirectedEdges -c 85283473fffffff
</TabItem>
</Tabs>
Provides all of the directed edges from the current H3Index. `edges` must be of length 6,
and the number of directed edges placed in the array may be less than 6. If this is the case,
one of the members of the array will be `0`.
## directedEdgeToBoundary
Provides the geographic lat/lng coordinates defining the directed edge.
Note that this may be more than two points for complex edges.
<Tabs
groupId="language"
defaultValue="c"
Expand All @@ -548,6 +568,8 @@ one of the members of the array will be `0`.
H3Error directedEdgeToBoundary(H3Index edge, CellBoundary* gb);
```
Returns 0 (`E_SUCCESS`) on success.
</TabItem>
<TabItem value="java">
Expand All @@ -574,7 +596,7 @@ function example() {
<TabItem value="python">
```py
h3.directed_edge_to_boundary(edge, geo_json=False)
h3.directed_edge_to_boundary(edge)
```
</TabItem>
Expand All @@ -598,5 +620,3 @@ $ h3 directedEdgeToBoundary -c 115283473fffffff
</TabItem>
</Tabs>
Provides the coordinates defining the unidirectional edge.
Loading

0 comments on commit f0d6cd4

Please sign in to comment.