Skip to content

Commit

Permalink
Add shell docs for the H3 CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
dfellis committed Oct 14, 2024
1 parent a4427ef commit 2bd05b7
Show file tree
Hide file tree
Showing 8 changed files with 1,827 additions and 529 deletions.
282 changes: 218 additions & 64 deletions website/docs/api/directededge.mdx

Large diffs are not rendered by default.

330 changes: 266 additions & 64 deletions website/docs/api/hierarchy.mdx

Large diffs are not rendered by default.

107 changes: 83 additions & 24 deletions website/docs/api/indexing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ These functions are used for finding the H3 cell index containing coordinates, a
defaultValue="c"
values={[
{label: 'C', value: 'c'},
{label: 'Python', value: 'python'},
{label: 'Java', value: 'java'},
{label: 'JavaScript (Live)', value: 'javascript'},
{label: 'Python', value: 'python'},
{label: 'Shell', value: 'shell'},
]
}>
<TabItem value="c">
Expand All @@ -28,13 +29,6 @@ These functions are used for finding the H3 cell index containing coordinates, a
H3Error latLngToCell(const LatLng *g, int res, H3Index *out);
```
</TabItem>
<TabItem value="python">
```py
h3.latlng_to_cell(lat, lng, resolution)
```

</TabItem>
<TabItem value="java">
Expand All @@ -59,6 +53,33 @@ function example() {
}
```

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

```py
h3.latlng_to_cell(lat, lng, resolution)
```

</TabItem>
<TabItem value="shell">

```sh
$ h3 latLngToCell --help
h3: Convert degrees latitude/longitude coordinate to an H3 cell
H3 4.1.0

latLngToCell Convert degrees latitude/longitude coordinate to an H3 cell
-h, --help Show this help message.
-r, --resolution <res> Required. Resolution, 0-15 inclusive.
--lat, --latitude <lat>Required. Latitude in degrees.
--lng, --longitude <lng> Required. Longitude in degrees.
```

```bash
$ h3 latLngToCell --lat 45 --lng 40 -r 2
822d57fffffffff
```

</TabItem>
</Tabs>

Expand All @@ -74,9 +95,10 @@ Returns 0 (`E_SUCCESS`) on success.
defaultValue="c"
values={[
{label: 'C', value: 'c'},
{label: 'Python', value: 'python'},
{label: 'Java', value: 'java'},
{label: 'JavaScript (Live)', value: 'javascript'},
{label: 'Python', value: 'python'},
{label: 'Shell', value: 'shell'},
]
}>
<TabItem value="c">
Expand All @@ -85,13 +107,6 @@ Returns 0 (`E_SUCCESS`) on success.
H3Error cellToLatLng(H3Index cell, LatLng *g);
```
</TabItem>
<TabItem value="python">
```py
h3.cell_to_latlng(cell)
```

</TabItem>
<TabItem value="java">
Expand All @@ -114,6 +129,31 @@ function example() {
}
```

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

```py
h3.cell_to_latlng(cell)
```

</TabItem>
<TabItem value="shell">

```sh
$ h3 cellToLatLng --help
h3: Convert an H3Cell to a WKT POINT coordinate
H3 4.1.0

cellToLatLng Convert an H3Cell to a WKT POINT coordinate
-h, --help Show this help message.
-c, --cell <index> Required. H3 Cell
```

```bash
$ h3 cellToLatLng -c 85283473fffffff
POINT(-121.9763759726 37.3457933754)
```

</TabItem>
</Tabs>

Expand All @@ -135,9 +175,10 @@ Returns 0 (`E_SUCCESS`) on success.
defaultValue="c"
values={[
{label: 'C', value: 'c'},
{label: 'Python', value: 'python'},
{label: 'Java', value: 'java'},
{label: 'JavaScript (Live)', value: 'javascript'},
{label: 'Python', value: 'python'},
{label: 'Shell', value: 'shell'},
]
}>
<TabItem value="c">
Expand All @@ -146,13 +187,6 @@ Returns 0 (`E_SUCCESS`) on success.
H3Error cellToBoundary(H3Index cell, CellBoundary *bndry);
```
</TabItem>
<TabItem value="python">
```py
h3.cell_to_boundary(cell, geo_json=False)
```

</TabItem>
<TabItem value="java">
Expand All @@ -175,6 +209,31 @@ function example() {
}
```

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

```py
h3.cell_to_boundary(cell, geo_json=False)
```

</TabItem>
<TabItem value="shell">

```sh
$ h3 cellToBoundary --help
h3: Convert an H3 cell to a WKT POLYGON defining its boundary
H3 4.1.0

cellToBoundary Convert an H3 cell to a WKT POLYGON defining its boundary
-h, --help Show this help message.
-c, --cell <index> Required. H3 Cell
```

```bash
$ h3 cellToBoundary -c 85283473fffffff
POLYGON((-121.9150803271 37.2713558667, -121.8622232890 37.3539264509, -121.9235499963 37.4283411861, -122.0377349643 37.4201286777, -122.0904289290 37.3375560844, -122.0291013092 37.2631979746, -121.9150803271 37.2713558667))
```

</TabItem>
</Tabs>

Expand Down
Loading

0 comments on commit 2bd05b7

Please sign in to comment.