Skip to content

Commit

Permalink
removing 'function' defs
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed Oct 9, 2023
1 parent 60b0b70 commit b701e62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 82 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: h3r
Type: Package
Title: Hexagonal Hierarchical Geospatial Indexing System
Version: 0.1.0
Version: 0.1.1
Date: 2023-09-28
Authors@R: c(
person("David", "Cooley", ,"[email protected]", role = c("aut", "cre")),
Expand Down
14 changes: 7 additions & 7 deletions data-raw/DATASET.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Read `h3libapi.h` and write all 'inline' function defs to `init.c`

lines <- readLines("~/Documents/github/h3lib/inst/include/h3libapi.h")
fns <- lines[ grepl("inline ", lines) ]
fns <- gsub("inline ", "", fns)
fns <- gsub("\\(.*","",fns)
fns <- gsub(" ", " (*", fns)
fns <- paste0(fns, ");\n")
cat(fns)
# lines <- readLines("~/Documents/github/h3lib/inst/include/h3libapi.h")
# fns <- lines[ grepl("inline ", lines) ]
# fns <- gsub("inline ", "", fns)
# fns <- gsub("\\(.*","",fns)
# fns <- gsub(" ", " (*", fns)
# fns <- paste0(fns, ");\n")
# cat(fns)


stations <- structure(list(stop_id = c("15351", "15353", "19827", "19828",
Expand Down
74 changes: 0 additions & 74 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,80 +192,6 @@ typedef struct {
int j; ///< j component
} CoordIJ;

/*Function Definitions /data-raw/DATASET.R*/
H3Error (*latLngToCell);
H3Error (*cellToLatLng);
H3Error (*cellToBoundary);
int (*getResolution);
int (*getBaseCellNumber);
H3Error (*stringToH3);
//H3Error (*h3ToString);
int (*isValidCell);
int (*isResClassIII);
int (*isPentagon);
H3Error (*getIcosahedronFaces);
H3Error (*maxFaceCount);
H3Error (*gridDisk);
H3Error (*maxGridDiskSize);
H3Error (*gridDiskDistances);
H3Error (*gridDiskUnsafe);
H3Error (*gridDiskDistancesUnsafe);
H3Error (*gridDiskDistancesSafe);
H3Error (*gridDisksUnsafe);
H3Error (*gridRingUnsafe);
H3Error (*gridPathCells);
H3Error (*gridPathCellsSize);
H3Error (*gridDistance);
H3Error (*cellToLocalIj);
H3Error (*localIjToCell);
H3Error (*cellToParent);
H3Error (*cellToChildren);
H3Error (*cellToChildrenSize);
H3Error (*cellToCenterChild);
H3Error (*cellToChildPos);
H3Error (*childPosToCell);
H3Error (*compactCells);
H3Error (*uncompactCells);
H3Error (*uncompactCellsSize);
H3Error (*polygonToCells);
H3Error (*maxPolygonToCellsSize);
H3Error (*cellsToLinkedMultiPolygon);
void (*destroyLinkedMultiPolygon);
H3Error (*areNeighborCells);
H3Error (*cellsToDirectedEdge);
int (*isValidDirectedEdge);
H3Error (*getDirectedEdgeOrigin);
H3Error (*getDirectedEdgeDestination);
H3Error (*directedEdgeToCells);
H3Error (*originToDirectedEdges);
H3Error (*directedEdgeToBoundary);
H3Error (*cellToVertex);
H3Error (*cellToVertexes);
H3Error (*vertexToLatLng);
int (*isValidVertex);
double (*degsToRads);
double (*radsToDegs);
H3Error (*getHexagonAreaAvgKm2);
H3Error (*getHexagonAreaAvgM2);
H3Error (*cellAreaRads2);
H3Error (*cellAreaKm2);
H3Error (*cellAreaM2);
H3Error (*getHexagonEdgeLengthAvgKm);
H3Error (*getHexagonEdgeLengthAvgM);
H3Error (*edgeLengthKm);
H3Error (*edgeLengthM);
H3Error (*edgeLengthRads);
H3Error (*getNumCells);
H3Error (*getRes0Cells);
int (*res0CellCount);
H3Error (*getPentagons);
int (*pentagonCount);
double (*greatCircleDistanceKm);
double (*greatCircleDistanceM);
double (*greatCircleDistanceRads);
Direction (*directionForNeighbor);
/*End Function Definitions*/

void attribute_visible R_init_h3r(DllInfo *info)
{
R_registerRoutines(info, NULL, callMethods, NULL, NULL);
Expand Down

0 comments on commit b701e62

Please sign in to comment.