From b701e62fd2e73b979f43869dd80c595524665752 Mon Sep 17 00:00:00 2001 From: dcooley <=> Date: Mon, 9 Oct 2023 16:12:04 +1100 Subject: [PATCH] removing 'function' defs --- DESCRIPTION | 2 +- data-raw/DATASET.R | 14 ++++----- src/init.c | 74 ---------------------------------------------- 3 files changed, 8 insertions(+), 82 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d032c18..ae27c53 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", ,"dcooley@symbolix.com.au", role = c("aut", "cre")), diff --git a/data-raw/DATASET.R b/data-raw/DATASET.R index 6327f01..a3f1369 100644 --- a/data-raw/DATASET.R +++ b/data-raw/DATASET.R @@ -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", diff --git a/src/init.c b/src/init.c index a7c0533..f76b363 100644 --- a/src/init.c +++ b/src/init.c @@ -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);