OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
h3api.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-2020 Uber Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
23 #ifndef H3API_H
24 #define H3API_H
25 
26 // OmniSci addition adding OmniSci-specific includes
27 #include <cmath>
29 // End OmniSci addition
30 
31 /*
32  * Preprocessor code to support renaming (prefixing) the public API.
33  * All public functions should be wrapped in H3_EXPORT so they can be
34  * renamed.
35  */
36 #ifdef H3_PREFIX
37 #define XTJOIN(a, b) a##b
38 #define TJOIN(a, b) XTJOIN(a, b)
39 
40 /* export joins the user provided prefix with our exported function name */
41 #define H3_EXPORT(name) TJOIN(H3_PREFIX, name)
42 #else
43 #define H3_EXPORT(name) name
44 #endif
45 
46 // /* Windows DLL requires attributes indicating what to export */
47 // #if _WIN32 && BUILD_SHARED_LIBS
48 // #if BUILDING_H3
49 // #define DECLSPEC __declspec(dllexport)
50 // #else
51 // #define DECLSPEC __declspec(dllimport)
52 // #endif
53 // #else
54 // #define DECLSPEC
55 // #endif
56 
57 #ifndef __CUDACC__
58 /* For uint64_t */
59 #include <stdint.h>
60 // /* For size_t */
61 // #include <stdlib.h>
62 #endif
63 
64 // /*
65 // * H3 is compiled as C, not C++ code. `extern "C"` is needed for C++ code
66 // * to be able to use the library.
67 // */
68 // #ifdef __cplusplus
69 // extern "C" {
70 // #endif
71 
73 // OmniSci addition - changed from uint64_t to int64_t because calcite types does not
74 // recognize the unsigned version as of 01/28/2021
75 #define H3Index int64_t
76 
77 // /* library version numbers generated from VERSION file */
78 // // clang-format off
79 // #define H3_VERSION_MAJOR 3
80 // #define H3_VERSION_MINOR 7
81 // #define H3_VERSION_PATCH 1
82 // // clang-format on
83 
84 // /** Maximum number of cell boundary vertices; worst case is pentagon:
85 // * 5 original verts + 5 edge crossings
86 // */
87 // #define MAX_CELL_BNDRY_VERTS 10
88 
89 // /** @struct GeoCoord
90 // @brief latitude/longitude in radians
91 // */
92 #define LAT_INDEX 0
93 #define LON_INDEX 1
94 #define GeoCoord(variable_name) double variable_name[2]
95 #define GeoCoordArray(variable_name, size) double variable_name[size][2]
96 #define GeoCoordCopy(dest_coord, src_coord) \
97  dest_coord[LAT_INDEX] = src_coord[LAT_INDEX]; \
98  dest_coord[LON_INDEX] = src_coord[LON_INDEX];
99 // typedef struct {
100 // double lat; ///< latitude in radians
101 // double lon; ///< longitude in radians
102 // } GeoCoord;
103 
104 // /** @struct GeoBoundary
105 // @brief cell boundary in latitude/longitude
106 // */
107 // typedef struct {
108 // int numVerts; ///< number of vertices
109 // GeoCoord verts[MAX_CELL_BNDRY_VERTS]; ///< vertices in ccw order
110 // } GeoBoundary;
111 
112 // /** @struct Geofence
113 // * @brief similar to GeoBoundary, but requires more alloc work
114 // */
115 // typedef struct {
116 // int numVerts;
117 // GeoCoord *verts;
118 // } Geofence;
119 
120 // /** @struct GeoPolygon
121 // * @brief Simplified core of GeoJSON Polygon coordinates definition
122 // */
123 // typedef struct {
124 // Geofence geofence; ///< exterior boundary of the polygon
125 // int numHoles; ///< number of elements in the array pointed to by holes
126 // Geofence *holes; ///< interior boundaries (holes) in the polygon
127 // } GeoPolygon;
128 
129 // /** @struct GeoMultiPolygon
130 // * @brief Simplified core of GeoJSON MultiPolygon coordinates definition
131 // */
132 // typedef struct {
133 // int numPolygons;
134 // GeoPolygon *polygons;
135 // } GeoMultiPolygon;
136 
137 // /** @struct LinkedGeoCoord
138 // * @brief A coordinate node in a linked geo structure, part of a linked list
139 // */
140 // typedef struct LinkedGeoCoord LinkedGeoCoord;
141 // struct LinkedGeoCoord {
142 // GeoCoord vertex;
143 // LinkedGeoCoord *next;
144 // };
145 
146 // /** @struct LinkedGeoLoop
147 // * @brief A loop node in a linked geo structure, part of a linked list
148 // */
149 // typedef struct LinkedGeoLoop LinkedGeoLoop;
150 // struct LinkedGeoLoop {
151 // LinkedGeoCoord *first;
152 // LinkedGeoCoord *last;
153 // LinkedGeoLoop *next;
154 // };
155 
156 // /** @struct LinkedGeoPolygon
157 // * @brief A polygon node in a linked geo structure, part of a linked list.
158 // */
159 // typedef struct LinkedGeoPolygon LinkedGeoPolygon;
160 // struct LinkedGeoPolygon {
161 // LinkedGeoLoop *first;
162 // LinkedGeoLoop *last;
163 // LinkedGeoPolygon *next;
164 // };
165 
166 // /** @struct CoordIJ
167 // * @brief IJ hexagon coordinates
168 // *
169 // * Each axis is spaced 120 degrees apart.
170 // */
171 // typedef struct {
172 // int i; ///< i component
173 // int j; ///< j component
174 // } CoordIJ;
175 
182 EXTENSION_NOINLINE H3Index H3_EXPORT(geoToH3)(const double lon,
183  const double lat,
184  int res);
197 // /** @defgroup h3ToGeoBoundary h3ToGeoBoundary
198 // * Functions for h3ToGeoBoundary
199 // * @{
200 // */
201 // /** @brief give the cell boundary in lat/lon coordinates for the cell h3 */
202 // DECLSPEC void H3_EXPORT(h3ToGeoBoundary)(H3Index h3, GeoBoundary *gp);
203 // /** @} */
204 
205 // /** @defgroup kRing kRing
206 // * Functions for kRing
207 // * @{
208 // */
209 // /** @brief maximum number of hexagons in k-ring */
210 // DECLSPEC int H3_EXPORT(maxKringSize)(int k);
211 
212 // /** @brief hexagons neighbors in all directions, assuming no pentagons */
213 // DECLSPEC int H3_EXPORT(hexRange)(H3Index origin, int k, H3Index *out);
214 // /** @} */
215 
216 // /** @brief hexagons neighbors in all directions, assuming no pentagons,
217 // * reporting distance from origin */
218 // DECLSPEC int H3_EXPORT(hexRangeDistances)(H3Index origin, int k, H3Index *out,
219 // int *distances);
220 
221 // /** @brief collection of hex rings sorted by ring for all given hexagons */
222 // DECLSPEC int H3_EXPORT(hexRanges)(H3Index *h3Set, int length, int k,
223 // H3Index *out);
224 
225 // /** @brief hexagon neighbors in all directions */
226 // DECLSPEC void H3_EXPORT(kRing)(H3Index origin, int k, H3Index *out);
227 // /** @} */
228 
229 // /** @defgroup kRingDistances kRingDistances
230 // * Functions for kRingDistances
231 // * @{
232 // */
233 // /** @brief hexagon neighbors in all directions, reporting distance from origin
234 // */
235 // DECLSPEC void H3_EXPORT(kRingDistances)(H3Index origin, int k, H3Index *out,
236 // int *distances);
237 // /** @} */
238 
239 // /** @defgroup hexRing hexRing
240 // * Functions for hexRing
241 // * @{
242 // */
243 // /** @brief hollow hexagon ring at some origin */
244 // DECLSPEC int H3_EXPORT(hexRing)(H3Index origin, int k, H3Index *out);
245 // /** @} */
246 
247 // /** @defgroup polyfill polyfill
248 // * Functions for polyfill
249 // * @{
250 // */
251 // /** @brief maximum number of hexagons in the geofence */
252 // DECLSPEC int H3_EXPORT(maxPolyfillSize)(const GeoPolygon *geoPolygon, int res);
253 
254 // /** @brief hexagons within the given geofence */
255 // DECLSPEC void H3_EXPORT(polyfill)(const GeoPolygon *geoPolygon, int res,
256 // H3Index *out);
257 // /** @} */
258 
259 // /** @defgroup h3SetToMultiPolygon h3SetToMultiPolygon
260 // * Functions for h3SetToMultiPolygon (currently a binding-only concept)
261 // * @{
262 // */
263 // /** @brief Create a LinkedGeoPolygon from a set of contiguous hexagons */
264 // DECLSPEC void H3_EXPORT(h3SetToLinkedGeo)(const H3Index *h3Set,
265 // const int numHexes,
266 // LinkedGeoPolygon *out);
267 
268 // /** @brief Free all memory created for a LinkedGeoPolygon */
269 // DECLSPEC void H3_EXPORT(destroyLinkedPolygon)(LinkedGeoPolygon *polygon);
270 // /** @} */
271 
288 // /** @defgroup pointDist pointDist
289 // * Functions for pointDist
290 // * @{
291 // */
292 // /** @brief "great circle distance" between pairs of GeoCoord points in radians*/
293 // double H3_EXPORT(pointDistRads)(const GeoCoord *a, const GeoCoord *b);
294 
295 // /** @brief "great circle distance" between pairs of GeoCoord points in
296 // * kilometers*/
297 // double H3_EXPORT(pointDistKm)(const GeoCoord *a, const GeoCoord *b);
298 
299 // /** @brief "great circle distance" between pairs of GeoCoord points in meters*/
300 // double H3_EXPORT(pointDistM)(const GeoCoord *a, const GeoCoord *b);
301 // /** @} */
302 
303 // /** @defgroup hexArea hexArea
304 // * Functions for hexArea
305 // * @{
306 // */
307 // /** @brief average hexagon area in square kilometers (excludes pentagons) */
308 // DECLSPEC double H3_EXPORT(hexAreaKm2)(int res);
309 
310 // /** @brief average hexagon area in square meters (excludes pentagons) */
311 // DECLSPEC double H3_EXPORT(hexAreaM2)(int res);
312 // /** @} */
313 
314 // /** @defgroup cellArea cellArea
315 // * Functions for cellArea
316 // * @{
317 // */
318 // /** @brief exact area for a specific cell (hexagon or pentagon) in radians^2 */
319 // double H3_EXPORT(cellAreaRads2)(H3Index h);
320 
321 // /** @brief exact area for a specific cell (hexagon or pentagon) in kilometers^2
322 // */
323 // double H3_EXPORT(cellAreaKm2)(H3Index h);
324 
325 // /** @brief exact area for a specific cell (hexagon or pentagon) in meters^2 */
326 // double H3_EXPORT(cellAreaM2)(H3Index h);
327 // /** @} */
328 
329 // /** @defgroup edgeLength edgeLength
330 // * Functions for edgeLength
331 // * @{
332 // */
333 // /** @brief average hexagon edge length in kilometers (excludes pentagons) */
334 // DECLSPEC double H3_EXPORT(edgeLengthKm)(int res);
335 
336 // /** @brief average hexagon edge length in meters (excludes pentagons) */
337 // DECLSPEC double H3_EXPORT(edgeLengthM)(int res);
338 // /** @} */
339 
340 // /** @defgroup exactEdgeLength exactEdgeLength
341 // * Functions for exactEdgeLength
342 // * @{
343 // */
344 // /** @brief exact length for a specific unidirectional edge in radians*/
345 // double H3_EXPORT(exactEdgeLengthRads)(H3Index edge);
346 
347 // /** @brief exact length for a specific unidirectional edge in kilometers*/
348 // double H3_EXPORT(exactEdgeLengthKm)(H3Index edge);
349 
350 // /** @brief exact length for a specific unidirectional edge in meters*/
351 // double H3_EXPORT(exactEdgeLengthM)(H3Index edge);
352 // /** @} */
353 
354 // /** @defgroup numHexagons numHexagons
355 // * Functions for numHexagons
356 // * @{
357 // */
358 // /** @brief number of cells (hexagons and pentagons) for a given resolution
359 // *
360 // * It works out to be `2 + 120*7^r` for resolution `r`.
361 // *
362 // * # Mathematical notes
363 // *
364 // * Let h(n) be the number of children n levels below
365 // * a single *hexagon*.
366 // *
367 // * Then h(n) = 7^n.
368 // *
369 // * Let p(n) be the number of children n levels below
370 // * a single *pentagon*.
371 // *
372 // * Then p(0) = 1, and p(1) = 6, since each pentagon
373 // * has 5 hexagonal immediate children and 1 pentagonal
374 // * immediate child.
375 // *
376 // * In general, we have the recurrence relation
377 // *
378 // * p(n) = 5*h(n-1) + p(n-1)
379 // * = 5*7^(n-1) + p(n-1).
380 // *
381 // * Working through the recurrence, we get that
382 // *
383 // * p(n) = 1 + 5*\sum_{k=1}^n 7^{k-1}
384 // * = 1 + 5*(7^n - 1)/6,
385 // *
386 // * using the closed form for a geometric series.
387 // *
388 // * Using the closed forms for h(n) and p(n), we can
389 // * get a closed form for the total number of cells
390 // * at resolution r:
391 // *
392 // * c(r) = 12*p(r) + 110*h(r)
393 // * = 2 + 120*7^r.
394 // *
395 // *
396 // * @param res H3 cell resolution
397 // *
398 // * @return number of cells at resolution `res`
399 // */
400 // DECLSPEC int64_t H3_EXPORT(numHexagons)(int res);
401 // /** @} */
402 
403 // /** @defgroup getRes0Indexes getRes0Indexes
404 // * Functions for getRes0Indexes
405 // * @{
406 // */
407 // /** @brief returns the number of resolution 0 cells (hexagons and pentagons) */
408 // DECLSPEC int H3_EXPORT(res0IndexCount)();
409 
410 // /** @brief provides all base cells in H3Index format*/
411 // DECLSPEC void H3_EXPORT(getRes0Indexes)(H3Index *out);
412 // /** @} */
413 
414 // /** @defgroup getPentagonIndexes getPentagonIndexes
415 // * Functions for getPentagonIndexes
416 // * @{
417 // */
418 // /** @brief returns the number of pentagons per resolution */
419 // DECLSPEC int H3_EXPORT(pentagonIndexCount)();
420 
421 // /** @brief generates all pentagons at the specified resolution */
422 // DECLSPEC void H3_EXPORT(getPentagonIndexes)(int res, H3Index *out);
423 // /** @} */
424 
425 // /** @defgroup h3GetResolution h3GetResolution
426 // * Functions for h3GetResolution
427 // * @{
428 // */
429 // /** @brief returns the resolution of the provided H3 index
430 // * Works on both cells and unidirectional edges. */
431 // DECLSPEC int H3_EXPORT(h3GetResolution)(H3Index h);
432 // /** @} */
433 
434 // /** @defgroup h3GetBaseCell h3GetBaseCell
435 // * Functions for h3GetBaseCell
436 // * @{
437 // */
438 // /** @brief returns the base cell "number" (0 to 121) of the provided H3 cell
439 // *
440 // * Note: Technically works on H3 edges, but will return base cell of the
441 // * origin cell. */
442 // DECLSPEC int H3_EXPORT(h3GetBaseCell)(H3Index h);
443 // /** @} */
444 
445 // /** @defgroup stringToH3 stringToH3
446 // * Functions for stringToH3
447 // * @{
448 // */
449 // /** @brief converts the canonical string format to H3Index format */
450 // DECLSPEC H3Index H3_EXPORT(stringToH3)(const char *str);
451 // /** @} */
452 
453 // /** @defgroup h3ToString h3ToString
454 // * Functions for h3ToString
455 // * @{
456 // */
457 // /** @brief converts an H3Index to a canonical string */
458 // DECLSPEC void H3_EXPORT(h3ToString)(H3Index h, char *str, size_t sz);
459 // /** @} */
460 
461 // /** @defgroup h3IsValid h3IsValid
462 // * Functions for h3IsValid
463 // * @{
464 // */
465 // /** @brief confirms if an H3Index is a valid cell (hexagon or pentagon)
466 // * In particular, returns 0 (False) for H3 unidirectional edges or invalid data
467 // */
468 // DECLSPEC int H3_EXPORT(h3IsValid)(H3Index h);
469 // /** @} */
470 
480 // /** @defgroup h3ToChildren h3ToChildren
481 // * Functions for h3ToChildren
482 // * @{
483 // */
484 // /** @brief determines the maximum number of children (or grandchildren, etc)
485 // * that could be returned for the given hexagon */
486 // DECLSPEC int64_t H3_EXPORT(maxH3ToChildrenSize)(H3Index h, int childRes);
487 
488 // /** @brief provides the children (or grandchildren, etc) of the given hexagon */
489 // DECLSPEC void H3_EXPORT(h3ToChildren)(H3Index h, int childRes,
490 // H3Index *children);
491 // /** @} */
492 
493 // /** @defgroup h3ToCenterChild h3ToCenterChild
494 // * Functions for h3ToCenterChild
495 // * @{
496 // */
497 // /** @brief returns the center child of the given hexagon at the specified
498 // * resolution */
499 // DECLSPEC H3Index H3_EXPORT(h3ToCenterChild)(H3Index h, int childRes);
500 // /** @} */
501 
502 // /** @defgroup compact compact
503 // * Functions for compact
504 // * @{
505 // */
506 // /** @brief compacts the given set of hexagons as best as possible */
507 // DECLSPEC int H3_EXPORT(compact)(const H3Index *h3Set, H3Index *compactedSet,
508 // const int numHexes);
509 // /** @} */
510 
511 // /** @defgroup uncompact uncompact
512 // * Functions for uncompact
513 // * @{
514 // */
515 // /** @brief determines the maximum number of hexagons that could be uncompacted
516 // * from the compacted set */
517 // DECLSPEC int H3_EXPORT(maxUncompactSize)(const H3Index *compactedSet,
518 // const int numHexes, const int res);
519 
520 // /** @brief uncompacts the compacted hexagon set */
521 // DECLSPEC int H3_EXPORT(uncompact)(const H3Index *compactedSet,
522 // const int numHexes, H3Index *h3Set,
523 // const int maxHexes, const int res);
524 // /** @} */
525 
526 // /** @defgroup h3IsResClassIII h3IsResClassIII
527 // * Functions for h3IsResClassIII
528 // * @{
529 // */
530 // /** @brief determines if a hexagon is Class III (or Class II) */
531 // DECLSPEC int H3_EXPORT(h3IsResClassIII)(H3Index h);
532 // /** @} */
533 
534 // /** @defgroup h3IsPentagon h3IsPentagon
535 // * Functions for h3IsPentagon
536 // * @{
537 // */
538 // /** @brief determines if an H3 cell is a pentagon */
539 // DECLSPEC int H3_EXPORT(h3IsPentagon)(H3Index h);
540 // /** @} */
541 
542 // /** @defgroup h3GetFaces h3GetFaces
543 // * Functions for h3GetFaces
544 // * @{
545 // */
546 // /** @brief Max number of icosahedron faces intersected by an index */
547 // DECLSPEC int H3_EXPORT(maxFaceCount)(H3Index h3);
548 
549 // /** @brief Find all icosahedron faces intersected by a given H3 index */
550 // DECLSPEC void H3_EXPORT(h3GetFaces)(H3Index h3, int *out);
551 // /** @} */
552 
553 // /** @defgroup h3IndexesAreNeighbors h3IndexesAreNeighbors
554 // * Functions for h3IndexesAreNeighbors
555 // * @{
556 // */
557 // /** @brief returns whether or not the provided hexagons border */
558 // DECLSPEC int H3_EXPORT(h3IndexesAreNeighbors)(H3Index origin,
559 // H3Index destination);
560 // /** @} */
561 
562 // /** @defgroup getH3UnidirectionalEdge getH3UnidirectionalEdge
563 // * Functions for getH3UnidirectionalEdge
564 // * @{
565 // */
566 // /** @brief returns the unidirectional edge H3Index for the specified origin and
567 // * destination */
568 // DECLSPEC H3Index H3_EXPORT(getH3UnidirectionalEdge)(H3Index origin,
569 // H3Index destination);
570 // /** @} */
571 
572 // /** @defgroup h3UnidirectionalEdgeIsValid h3UnidirectionalEdgeIsValid
573 // * Functions for h3UnidirectionalEdgeIsValid
574 // * @{
575 // */
576 // /** @brief returns whether the H3Index is a valid unidirectional edge */
577 // DECLSPEC int H3_EXPORT(h3UnidirectionalEdgeIsValid)(H3Index edge);
578 // /** @} */
579 
580 // /** @defgroup getOriginH3IndexFromUnidirectionalEdge
581 // * getOriginH3IndexFromUnidirectionalEdge
582 // * Functions for getOriginH3IndexFromUnidirectionalEdge
583 // * @{
584 // */
585 // /** @brief Returns the origin hexagon H3Index from the unidirectional edge
586 // * H3Index */
587 // DECLSPEC H3Index
588 // H3_EXPORT(getOriginH3IndexFromUnidirectionalEdge)(H3Index edge);
589 // /** @} */
590 
591 // /** @defgroup getDestinationH3IndexFromUnidirectionalEdge
592 // * getDestinationH3IndexFromUnidirectionalEdge
593 // * Functions for getDestinationH3IndexFromUnidirectionalEdge
594 // * @{
595 // */
596 // /** @brief Returns the destination hexagon H3Index from the unidirectional edge
597 // * H3Index */
598 // DECLSPEC H3Index
599 // H3_EXPORT(getDestinationH3IndexFromUnidirectionalEdge)(H3Index edge);
600 // /** @} */
601 
602 // /** @defgroup getH3IndexesFromUnidirectionalEdge
603 // * getH3IndexesFromUnidirectionalEdge
604 // * Functions for getH3IndexesFromUnidirectionalEdge
605 // * @{
606 // */
607 // /** @brief Returns the origin and destination hexagons from the unidirectional
608 // * edge H3Index */
609 // DECLSPEC void H3_EXPORT(getH3IndexesFromUnidirectionalEdge)(
610 // H3Index edge, H3Index *originDestination);
611 // /** @} */
612 
613 // /** @defgroup getH3UnidirectionalEdgesFromHexagon
614 // * getH3UnidirectionalEdgesFromHexagon
615 // * Functions for getH3UnidirectionalEdgesFromHexagon
616 // * @{
617 // */
618 // /** @brief Returns the 6 (or 5 for pentagons) edges associated with the H3Index
619 // */
620 // DECLSPEC void H3_EXPORT(getH3UnidirectionalEdgesFromHexagon)(H3Index origin,
621 // H3Index *edges);
622 // /** @} */
623 
624 // /** @defgroup getH3UnidirectionalEdgeBoundary getH3UnidirectionalEdgeBoundary
625 // * Functions for getH3UnidirectionalEdgeBoundary
626 // * @{
627 // */
628 // /** @brief Returns the GeoBoundary containing the coordinates of the edge */
629 // DECLSPEC void H3_EXPORT(getH3UnidirectionalEdgeBoundary)(H3Index edge,
630 // GeoBoundary *gb);
631 // /** @} */
632 
633 // /** @defgroup cellToVertex cellToVertex
634 // * Functions for cellToVertex
635 // * @{
636 // */
637 // /** @brief Returns a single vertex for a given cell, as an H3 index */
638 // DECLSPEC H3Index H3_EXPORT(cellToVertex)(H3Index origin, int vertexNum);
639 // /** @} */
640 
641 // /** @defgroup cellToVertexes cellToVertexes
642 // * Functions for cellToVertexes
643 // * @{
644 // */
645 // /** @brief Returns all vertexes for a given cell, as H3 indexes */
646 // DECLSPEC void H3_EXPORT(cellToVertexes)(H3Index origin, H3Index *vertexes);
647 // /** @} */
648 
649 // /** @defgroup vertexToPoint vertexToPoint
650 // * Functions for vertexToPoint
651 // * @{
652 // */
653 // /** @brief Returns a single vertex for a given cell, as an H3 index */
654 // DECLSPEC void H3_EXPORT(vertexToPoint)(H3Index vertex, GeoCoord *coord);
655 // /** @} */
656 
657 // /** @defgroup h3Distance h3Distance
658 // * Functions for h3Distance
659 // * @{
660 // */
661 // /** @brief Returns grid distance between two indexes */
662 // DECLSPEC int H3_EXPORT(h3Distance)(H3Index origin, H3Index h3);
663 // /** @} */
664 
665 // /** @defgroup h3Line h3Line
666 // * Functions for h3Line
667 // * @{
668 // */
669 // /** @brief Number of indexes in a line connecting two indexes */
670 // DECLSPEC int H3_EXPORT(h3LineSize)(H3Index start, H3Index end);
671 
672 // /** @brief Line of h3 indexes connecting two indexes */
673 // DECLSPEC int H3_EXPORT(h3Line)(H3Index start, H3Index end, H3Index *out);
674 // /** @} */
675 
676 // /** @defgroup experimentalH3ToLocalIj experimentalH3ToLocalIj
677 // * Functions for experimentalH3ToLocalIj
678 // * @{
679 // */
680 // /** @brief Returns two dimensional coordinates for the given index */
681 // DECLSPEC int H3_EXPORT(experimentalH3ToLocalIj)(H3Index origin, H3Index h3,
682 // CoordIJ *out);
683 // /** @} */
684 
685 // /** @defgroup experimentalLocalIjToH3 experimentalLocalIjToH3
686 // * Functions for experimentalLocalIjToH3
687 // * @{
688 // */
689 // /** @brief Returns index for the given two dimensional coordinates */
690 // DECLSPEC int H3_EXPORT(experimentalLocalIjToH3)(H3Index origin,
691 // const CoordIJ *ij,
692 // H3Index *out);
693 // /** @} */
694 
695 // #ifdef __cplusplus
696 // } // extern "C"
697 // #endif
698 
699 #endif
EXTENSION_NOINLINE double H3_EXPORT() h3ToLat(H3Index h3)
Definition: h3Index.hpp:887
#define EXTENSION_NOINLINE
Definition: heavydbTypes.h:58
#define H3_EXPORT(name)
Definition: h3api.h:43
EXTENSION_NOINLINE double H3_EXPORT() h3ToLon(H3Index h3)
Definition: h3Index.hpp:875
EXTENSION_NOINLINE H3Index H3_EXPORT() geoToH3(const double lon, const double lat, int res)
find the H3 index of the resolution res cell containing the lat/lng
Definition: h3Index.hpp:730
EXTENSION_INLINE double H3_EXPORT() radsToDegs(double radians)
converts radians to degrees
Definition: geoCoord.hpp:111
#define H3Index
the H3Index fits within a 64-bit unsigned integer
Definition: h3api.h:75
EXTENSION_NOINLINE H3Index H3_EXPORT() h3ToParent(H3Index h, int parentRes)
returns the parent (or grandparent, etc) hexagon of the given hexagon
Definition: h3Index.hpp:144
EXTENSION_NOINLINE int64_t H3_EXPORT() h3ToGeoPacked(H3Index h3)
find the lat/lon center point g of the cell h3
Definition: h3Index.hpp:853
#define EXTENSION_INLINE
Definition: heavydbTypes.h:57
EXTENSION_NOINLINE double radians(const double x)
EXTENSION_NOINLINE double degrees(double x)
EXTENSION_INLINE double H3_EXPORT() degsToRads(double degrees)
converts degrees to radians
Definition: geoCoord.hpp:101