Skip to content

Commit 5025e29

Browse files
authored
Merge pull request #91 from isaacbrodsky/accept-integer-input
Accept integer input
2 parents 8d507da + 213aaca commit 5025e29

File tree

3 files changed

+129
-69
lines changed

3 files changed

+129
-69
lines changed

README.md

+43-33
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const coordinates = h3.h3SetToMultiPolygon(hexagons, true);
129129
* [.degsToRads(deg)](#module_h3.degsToRads) ⇒ <code>number</code>
130130
* [.radsToDegs(rad)](#module_h3.radsToDegs) ⇒ <code>number</code>
131131
* [.H3Index](#module_h3.H3Index) : <code>string</code>
132+
* [.H3IndexInput](#module_h3.H3IndexInput) : <code>string</code> \| <code>Array.&lt;number&gt;</code>
132133
* [.CoordIJ](#module_h3.CoordIJ) : <code>Object</code>
133134
* [.UNITS](#module_h3.UNITS) : <code>Object</code>
134135

@@ -144,7 +145,7 @@ Whether a given string represents a valid H3 index
144145

145146
| Param | Type | Description |
146147
| --- | --- | --- |
147-
| h3Index | <code>H3Index</code> | H3 index to check |
148+
| h3Index | <code>H3IndexInput</code> | H3 index to check |
148149

149150

150151
* * *
@@ -158,7 +159,7 @@ Whether the given H3 index is a pentagon
158159

159160
| Param | Type | Description |
160161
| --- | --- | --- |
161-
| h3Index | <code>H3Index</code> | H3 index to check |
162+
| h3Index | <code>H3IndexInput</code> | H3 index to check |
162163

163164

164165
* * *
@@ -174,7 +175,7 @@ icosahedron edges, making them not true hexagons).
174175

175176
| Param | Type | Description |
176177
| --- | --- | --- |
177-
| h3Index | <code>H3Index</code> | H3 index to check |
178+
| h3Index | <code>H3IndexInput</code> | H3 index to check |
178179

179180

180181
* * *
@@ -188,7 +189,7 @@ Get the number of the base cell for a given H3 index
188189

189190
| Param | Type | Description |
190191
| --- | --- | --- |
191-
| h3Index | <code>H3Index</code> | H3 index to get the base cell for |
192+
| h3Index | <code>H3IndexInput</code> | H3 index to get the base cell for |
192193

193194

194195
* * *
@@ -202,7 +203,7 @@ Get the indices of all icosahedron faces intersected by a given H3 index
202203

203204
| Param | Type | Description |
204205
| --- | --- | --- |
205-
| h3Index | <code>H3Index</code> | H3 index to get faces for |
206+
| h3Index | <code>H3IndexInput</code> | H3 index to get faces for |
206207

207208

208209
* * *
@@ -216,7 +217,7 @@ Returns the resolution of an H3 index
216217

217218
| Param | Type | Description |
218219
| --- | --- | --- |
219-
| h3Index | <code>H3Index</code> | H3 index to get resolution |
220+
| h3Index | <code>H3IndexInput</code> | H3 index to get resolution |
220221

221222

222223
* * *
@@ -246,7 +247,7 @@ Get the lat,lon center of a given hexagon
246247

247248
| Param | Type | Description |
248249
| --- | --- | --- |
249-
| h3Index | <code>H3Index</code> | H3 index |
250+
| h3Index | <code>H3IndexInput</code> | H3 index |
250251

251252

252253
* * *
@@ -277,7 +278,7 @@ Get the parent of the given hexagon at a particular resolution
277278

278279
| Param | Type | Description |
279280
| --- | --- | --- |
280-
| h3Index | <code>H3Index</code> | H3 index to get parent for |
281+
| h3Index | <code>H3IndexInput</code> | H3 index to get parent for |
281282
| res | <code>number</code> | Resolution of hexagon to return |
282283

283284

@@ -292,7 +293,7 @@ Get the children/descendents of the given hexagon at a particular resolution
292293

293294
| Param | Type | Description |
294295
| --- | --- | --- |
295-
| h3Index | <code>H3Index</code> | H3 index to get children for |
296+
| h3Index | <code>H3IndexInput</code> | H3 index to get children for |
296297
| res | <code>number</code> | Resolution of hexagons to return |
297298

298299

@@ -307,7 +308,7 @@ Get the center child of the given hexagon at a particular resolution
307308

308309
| Param | Type | Description |
309310
| --- | --- | --- |
310-
| h3Index | <code>H3Index</code> | H3 index to get center child for |
311+
| h3Index | <code>H3IndexInput</code> | H3 index to get center child for |
311312
| res | <code>number</code> | Resolution of hexagon to return |
312313

313314

@@ -322,7 +323,7 @@ Get all hexagons in a k-ring around a given center. The order of the hexagons is
322323

323324
| Param | Type | Description |
324325
| --- | --- | --- |
325-
| h3Index | <code>H3Index</code> | H3 index of center hexagon |
326+
| h3Index | <code>H3IndexInput</code> | H3 index of center hexagon |
326327
| ringSize | <code>number</code> | Radius of k-ring |
327328

328329

@@ -338,7 +339,7 @@ ordered by distance from the origin. The order of the hexagons within each ring
338339

339340
| Param | Type | Description |
340341
| --- | --- | --- |
341-
| h3Index | <code>H3Index</code> | H3 index of center hexagon |
342+
| h3Index | <code>H3IndexInput</code> | H3 index of center hexagon |
342343
| ringSize | <code>number</code> | Radius of k-ring |
343344

344345

@@ -358,7 +359,7 @@ Unlike kRing, this function will throw an error if there is a pentagon anywhere
358359

359360
| Param | Type | Description |
360361
| --- | --- | --- |
361-
| h3Index | <code>H3Index</code> | H3 index of center hexagon |
362+
| h3Index | <code>H3IndexInput</code> | H3 index of center hexagon |
362363
| ringSize | <code>number</code> | Radius of ring |
363364

364365

@@ -401,7 +402,7 @@ algorithm may produce unexpected or invalid polygons.
401402

402403
| Param | Type | Description |
403404
| --- | --- | --- |
404-
| h3Indexes | <code>Array.&lt;H3Index&gt;</code> | H3 indexes to get outlines for |
405+
| h3Indexes | <code>Array.&lt;H3IndexInput&gt;</code> | H3 indexes to get outlines for |
405406
| [formatAsGeoJson] | <code>boolean</code> | Whether to provide GeoJSON output: [lng, lat], closed loops |
406407

407408

@@ -421,7 +422,7 @@ multiple levels that represents the same area.
421422

422423
| Param | Type | Description |
423424
| --- | --- | --- |
424-
| h3Set | <code>Array.&lt;H3Index&gt;</code> | H3 indexes to compact |
425+
| h3Set | <code>Array.&lt;H3IndexInput&gt;</code> | H3 indexes to compact |
425426

426427

427428
* * *
@@ -439,7 +440,7 @@ Uncompact a compacted set of hexagons to hexagons of the same resolution
439440

440441
| Param | Type | Description |
441442
| --- | --- | --- |
442-
| compactedSet | <code>Array.&lt;H3Index&gt;</code> | H3 indexes to uncompact |
443+
| compactedSet | <code>Array.&lt;H3IndexInput&gt;</code> | H3 indexes to uncompact |
443444
| res | <code>number</code> | The resolution to uncompact to |
444445

445446

@@ -454,8 +455,8 @@ Whether two H3 indexes are neighbors (share an edge)
454455

455456
| Param | Type | Description |
456457
| --- | --- | --- |
457-
| origin | <code>H3Index</code> | Origin hexagon index |
458-
| destination | <code>H3Index</code> | Destination hexagon index |
458+
| origin | <code>H3IndexInput</code> | Origin hexagon index |
459+
| destination | <code>H3IndexInput</code> | Destination hexagon index |
459460

460461

461462
* * *
@@ -469,8 +470,8 @@ Get an H3 index representing a unidirectional edge for a given origin and destin
469470

470471
| Param | Type | Description |
471472
| --- | --- | --- |
472-
| origin | <code>H3Index</code> | Origin hexagon index |
473-
| destination | <code>H3Index</code> | Destination hexagon index |
473+
| origin | <code>H3IndexInput</code> | Origin hexagon index |
474+
| destination | <code>H3IndexInput</code> | Destination hexagon index |
474475

475476

476477
* * *
@@ -484,7 +485,7 @@ Get the origin hexagon from an H3 index representing a unidirectional edge
484485

485486
| Param | Type | Description |
486487
| --- | --- | --- |
487-
| edgeIndex | <code>H3Index</code> | H3 index of the edge |
488+
| edgeIndex | <code>H3IndexInput</code> | H3 index of the edge |
488489

489490

490491
* * *
@@ -498,7 +499,7 @@ Get the destination hexagon from an H3 index representing a unidirectional edge
498499

499500
| Param | Type | Description |
500501
| --- | --- | --- |
501-
| edgeIndex | <code>H3Index</code> | H3 index of the edge |
502+
| edgeIndex | <code>H3IndexInput</code> | H3 index of the edge |
502503

503504

504505
* * *
@@ -512,7 +513,7 @@ Whether the input is a valid unidirectional edge
512513

513514
| Param | Type | Description |
514515
| --- | --- | --- |
515-
| edgeIndex | <code>H3Index</code> | H3 index of the edge |
516+
| edgeIndex | <code>H3IndexInput</code> | H3 index of the edge |
516517

517518

518519
* * *
@@ -526,7 +527,7 @@ Get the [origin, destination] pair represented by a unidirectional edge
526527

527528
| Param | Type | Description |
528529
| --- | --- | --- |
529-
| edgeIndex | <code>H3Index</code> | H3 index of the edge |
530+
| edgeIndex | <code>H3IndexInput</code> | H3 index of the edge |
530531

531532

532533
* * *
@@ -541,7 +542,7 @@ every neighbor)
541542

542543
| Param | Type | Description |
543544
| --- | --- | --- |
544-
| h3Index | <code>H3Index</code> | H3 index of the origin hexagon |
545+
| h3Index | <code>H3IndexInput</code> | H3 index of the origin hexagon |
545546

546547

547548
* * *
@@ -556,7 +557,7 @@ cross the edge of an icosahedron face, this may return 3 coordinates.
556557

557558
| Param | Type | Description |
558559
| --- | --- | --- |
559-
| edgeIndex | <code>H3Index</code> | H3 index of the edge |
560+
| edgeIndex | <code>H3IndexInput</code> | H3 index of the edge |
560561
| [formatAsGeoJson] | <code>boolean</code> | Whether to provide GeoJSON output: [lng, lat] |
561562

562563

@@ -574,8 +575,8 @@ on opposite sides of a pentagon.
574575

575576
| Param | Type | Description |
576577
| --- | --- | --- |
577-
| origin | <code>H3Index</code> | Origin hexagon index |
578-
| destination | <code>H3Index</code> | Destination hexagon index |
578+
| origin | <code>H3IndexInput</code> | Origin hexagon index |
579+
| destination | <code>H3IndexInput</code> | Destination hexagon index |
579580

580581

581582
* * *
@@ -606,8 +607,8 @@ Notes:
606607

607608
| Param | Type | Description |
608609
| --- | --- | --- |
609-
| origin | <code>H3Index</code> | Origin hexagon index |
610-
| destination | <code>H3Index</code> | Destination hexagon index |
610+
| origin | <code>H3IndexInput</code> | Origin hexagon index |
611+
| destination | <code>H3IndexInput</code> | Destination hexagon index |
611612

612613

613614
* * *
@@ -634,8 +635,8 @@ to be compatible across different versions of H3.
634635

635636
| Param | Type | Description |
636637
| --- | --- | --- |
637-
| origin | <code>H3Index</code> | Origin H3 index |
638-
| destination | <code>H3Index</code> | H3 index for which to find relative coordinates |
638+
| origin | <code>H3IndexInput</code> | Origin H3 index |
639+
| destination | <code>H3IndexInput</code> | H3 index for which to find relative coordinates |
639640

640641

641642
* * *
@@ -662,7 +663,7 @@ to be compatible across different versions of H3.
662663

663664
| Param | Type | Description |
664665
| --- | --- | --- |
665-
| origin | <code>H3Index</code> | Origin H3 index |
666+
| origin | <code>H3IndexInput</code> | Origin H3 index |
666667
| coords | <code>CoordIJ</code> | Coordinates as an `{i, j}` pair |
667668

668669

@@ -840,6 +841,15 @@ Convert radians to degrees
840841
64-bit hexidecimal string representation of an H3 index
841842

842843

844+
* * *
845+
846+
<a name="module_h3.H3IndexInput"></a>
847+
848+
### h3.H3IndexInput : <code>string</code> \| <code>Array.&lt;number&gt;</code>
849+
64-bit hexidecimal string representation of an H3 index,
850+
or two 32-bit integers in little endian order in an array.
851+
852+
843853
* * *
844854

845855
<a name="module_h3.CoordIJ"></a>

0 commit comments

Comments
 (0)