Skip to content

Commit

Permalink
ijk to hex
Browse files Browse the repository at this point in the history
  • Loading branch information
dave committed May 22, 2023
1 parent 68f82f6 commit 99bf96b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inst/include/h3libapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@ inline void _geoToClosestFace(const LatLng *g, int *face, double *sqd) {
fun(g, face, sqd);
}

inline void _ijkToHex2d(const CoordIJK *h, Vec2d *v) {
void(*fun)(const CoordIJK*, Vec2d*) =
(void(*)(const CoordIJK*, Vec2d*)) R_GetCCallable("h3lib", "_ijkToHex2d");
fun(h, v);
}

#ifdef __cplusplus
}
Expand Down
1 change: 1 addition & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void attribute_visible R_init_h3lib(DllInfo *info)
R_RegisterCCallable("h3lib", "_faceIjkToH3", (DL_FUNC) &_faceIjkToH3);
R_RegisterCCallable("h3lib", "cellToLocalIjk", (DL_FUNC) &cellToLocalIjk);
R_RegisterCCallable("h3lib", "_geoToClosestFace", (DL_FUNC) &_geoToClosestFace);
R_RegisterCCallable("h3lib", "_ijkToHex2d", (DL_FUNC) &_ijkToHex2d);


R_forceSymbols(info, TRUE); // controls visibility
Expand Down

0 comments on commit 99bf96b

Please sign in to comment.