Skip to content

Commit abc90c9

Browse files
committed
restructured headers and linking
1 parent 28723c7 commit abc90c9

File tree

7 files changed

+191
-261
lines changed

7 files changed

+191
-261
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BugReports: https://github.com/symbolixau/h3r/issues
1717
Encoding: UTF-8
1818
LazyData: true
1919
Depends:
20-
h3lib (>= 0.1.2),
20+
h3lib (>= 0.1.3),
2121
R (>= 2.10)
2222
LinkingTo:
2323
h3lib

inst/include/h3r.h

+186
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
#pragma once
2+
3+
#ifndef R_H3R_H
4+
#define R_H3R_H
5+
6+
#include <R.h>
7+
#include <Rinternals.h>
8+
#include <Rdefines.h>
9+
10+
#include "h3libapi.h"
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
H3Error (latLngToCell)(const LatLng*, int, H3Index*);
17+
H3Error (cellToLatLng)(H3Index, LatLng*);
18+
H3Error (cellToBoundary)(H3Index, CellBoundary*);
19+
H3Error (maxGridDiskSize)(int, int64_t*);
20+
H3Error (gridDiskUnsafe)(H3Index, int, H3Index*);
21+
H3Error (gridDiskDistancesUnsafe)(H3Index, int, H3Index*, int*);
22+
H3Error (gridDiskDistancesSafe)(H3Index, int, H3Index*, int*);
23+
H3Error (gridDisksUnsafe)(H3Index*, int, int, H3Index*);
24+
H3Error (gridDisk)(H3Index, int, H3Index*);
25+
H3Error (gridDiskDistances)(H3Index, int, H3Index*, int*);
26+
H3Error (gridRingUnsafe)(H3Index, int, H3Index*);
27+
H3Error (maxPolygonToCellsSize)(const GeoPolygon*, int, uint32_t, int64_t*);
28+
H3Error (polygonToCells)(const GeoPolygon*, int, uint32_t, H3Index*);
29+
H3Error (cellsToLinkedMultiPolygon)(const H3Index*, const int, LinkedGeoPolygon*);
30+
void (destroyLinkedMultiPolygon)(LinkedGeoPolygon*);
31+
double (degsToRads)(double);
32+
double (radsToDegs)(double);
33+
double (greatCircleDistanceRads)(const LatLng*, const LatLng*);
34+
double (greatCircleDistanceKm)(const LatLng*, const LatLng*);
35+
double (greatCircleDistanceM)(const LatLng*, const LatLng*);
36+
H3Error (getHexagonAreaAvgKm2)(int, double*);
37+
H3Error (getHexagonAreaAvgM2)(int, double*);
38+
H3Error (cellAreaRads2)(H3Index, double*);
39+
H3Error (cellAreaKm2)(H3Index, double*);
40+
H3Error (cellAreaM2)(H3Index, double*);
41+
H3Error (getHexagonEdgeLengthAvgKm)(int, double*);
42+
H3Error (getHexagonEdgeLengthAvgM)(int, double*);
43+
H3Error (edgeLengthRads)(H3Index, double*);
44+
H3Error (edgeLengthKm)(H3Index, double*);
45+
H3Error (edgeLengthM)(H3Index, double*);
46+
H3Error (getNumCells)(int, int64_t*);
47+
int (res0CellCount)(void);
48+
H3Error (getRes0Cells)(H3Index*);
49+
int (pentagonCount)(void);
50+
H3Error (getPentagons)(int, H3Index*);
51+
int (getResolution)(H3Index);
52+
int (getBaseCellNumber)(H3Index);
53+
H3Error (stringToH3)(const char*, H3Index*);
54+
int (isValidCell)(H3Index);
55+
H3Error (cellToParent)(H3Index, int, H3Index*);
56+
H3Error (cellToChildrenSize)(H3Index, int, int64_t*);
57+
H3Error (cellToChildren)(H3Index, int, H3Index*);
58+
H3Error (cellToCenterChild)(H3Index, int, H3Index*);
59+
H3Error (cellToChildPos)(H3Index, int, int64_t*);
60+
H3Error (childPosToCell)(int64_t, H3Index, int, H3Index*);
61+
H3Error (compactCells)(const H3Index*, H3Index*, const int64_t);
62+
H3Error (uncompactCellsSize)(const H3Index*, const int64_t, const int, int64_t*);
63+
H3Error (uncompactCells)(const H3Index*, const int64_t, H3Index*, const int64_t, const int);
64+
int (isResClassIII)(H3Index);
65+
int (isPentagon)(H3Index);
66+
H3Error (maxFaceCount)(H3Index, int*);
67+
H3Error (getIcosahedronFaces)(H3Index, int*);
68+
H3Error (areNeighborCells)(H3Index, H3Index, int*);
69+
H3Error (cellsToDirectedEdge)(H3Index, H3Index, H3Index*);
70+
int (isValidDirectedEdge)(H3Index);
71+
H3Error (getDirectedEdgeOrigin)(H3Index, H3Index*);
72+
H3Error (getDirectedEdgeDestination)(H3Index, H3Index*);
73+
H3Error (directedEdgeToCells)(H3Index, H3Index*);
74+
H3Error (originToDirectedEdges)(H3Index, H3Index*);
75+
H3Error (directedEdgeToBoundary)(H3Index, CellBoundary*);
76+
H3Error (cellToVertex)(H3Index, int, H3Index*);
77+
H3Error (cellToVertexes)(H3Index, H3Index*);
78+
H3Error (vertexToLatLng)(H3Index, LatLng*);
79+
int (isValidVertex)(H3Index);
80+
H3Error (gridDistance)(H3Index, H3Index, int64_t*);
81+
H3Error (gridPathCellsSize)(H3Index, H3Index, int64_t*);
82+
H3Error (gridPathCells)(H3Index, H3Index, H3Index*);
83+
H3Error (cellToLocalIj)(H3Index, H3Index, uint32_t, CoordIJ*);
84+
H3Error (localIjToCell)(H3Index, const CoordIJ*, uint32_t, H3Index*);
85+
Direction (directionForNeighbor)(H3Index, H3Index);
86+
void (_geoToClosestFace)(const LatLng*, int*, double*);
87+
double (degsToRads)(double);
88+
89+
// Indexing
90+
SEXP h3rLatLngToCell(SEXP lat, SEXP lng, SEXP res);
91+
SEXP h3rCellToLatLng(SEXP h3);
92+
SEXP h3rCellToBoundary(SEXP h3);
93+
94+
95+
// Inspection
96+
SEXP h3rGetResolution(SEXP h3);
97+
SEXP h3rGetBaseCellNumber(SEXP h3);
98+
SEXP h3rIsValidCell(SEXP h3);
99+
SEXP h3rIsResClassIII(SEXP h3);
100+
SEXP h3rIsPentagon(SEXP h3);
101+
SEXP h3rGetIcosahedronFaces(SEXP h3);
102+
SEXP h3rMaxFaceCount(SEXP h3);
103+
104+
// Traversal
105+
SEXP h3rGridDisk(SEXP h3, SEXP k);
106+
SEXP h3rMaxGridDiskSize(SEXP k);
107+
SEXP h3rGridDiskDistances(SEXP h3, SEXP k);
108+
SEXP h3rGridDiskUnsafe(SEXP h3, SEXP k) ;
109+
SEXP h3rGridDiskDistancesUnsafe(SEXP h3, SEXP k) ;
110+
SEXP h3rGridDiskDistancesSafe(SEXP h3, SEXP k);
111+
SEXP h3rGridRingUnsafe(SEXP h3, SEXP k);
112+
SEXP h3rGridPathCells(SEXP origH3, SEXP destH3);
113+
SEXP h3rGridPathCellsSize(SEXP origH3, SEXP destH3);
114+
SEXP h3rGridDistance(SEXP origH3, SEXP destH3);
115+
SEXP h3rCellToLocalIj(SEXP orig, SEXP h3);
116+
SEXP h3rLocalIjToCell(SEXP orig, SEXP coordI, SEXP coordJ);
117+
118+
// Hierarchy
119+
SEXP h3rCellToParent(SEXP h3, SEXP parentResolution);
120+
SEXP h3rCellToChildren(SEXP h3, SEXP childResolution);
121+
SEXP h3rCellToChildrenSize(SEXP h3, SEXP res);
122+
SEXP h3rCellToCenterChild(SEXP h3, SEXP res);
123+
SEXP h3rCellToChildPos(SEXP h3, SEXP res);
124+
SEXP h3rChildPosToCell(SEXP pos, SEXP h3, SEXP res);
125+
SEXP h3rCompactCells(SEXP h3Sets);
126+
SEXP h3rUncompactCells(SEXP h3Sets, SEXP res);
127+
128+
// Regions
129+
SEXP h3rPolygonToCells(SEXP polygonArray, SEXP res, SEXP isLatLng);
130+
SEXP h3rCellsToMultiPolygon(SEXP h3Sets, SEXP isGeoJson);
131+
132+
// Directed Edges
133+
SEXP h3rAreNeighborCells(SEXP origH3, SEXP destH3);
134+
SEXP h3rCellsToDirectedEdge(SEXP origH3, SEXP destH3);
135+
SEXP h3rIsValidDirectedEdge(SEXP edge);
136+
SEXP h3rGetDirectedEdgeOrigin(SEXP edge);
137+
SEXP h3rGetDirectedEdgeDestination(SEXP edge);
138+
SEXP h3rDirectedEdgeToCells(SEXP edge);
139+
SEXP h3rOriginToDirectedEdges(SEXP origH3);
140+
SEXP h3rDirectedEdgeToBoundary(SEXP h3);
141+
142+
// Vertexes
143+
SEXP h3rCellToVertex(SEXP h3, SEXP vertexNum);
144+
SEXP h3rCellToVertexes(SEXP h3);
145+
SEXP h3rVertexToLatLng(SEXP h3);
146+
SEXP h3rIsValidVertex(SEXP h3);
147+
148+
// Miscellaneous
149+
SEXP h3rDegsToRads(SEXP degrees);
150+
SEXP h3rRadsToDegs(SEXP degrees);
151+
152+
SEXP h3rGetHexagonArea(SEXP res, int areaType);
153+
SEXP h3rGetHexagonAreaAvgM2(SEXP res);
154+
SEXP h3rGetHexagonAreaAvgKm2(SEXP res);
155+
156+
SEXP h3rCellArea(SEXP h3, int areaType);
157+
SEXP h3rCellAreaRads2(SEXP h3);
158+
SEXP h3rCellAreaM2(SEXP h3);
159+
SEXP h3rCellAreaKm2(SEXP h3);
160+
161+
SEXP h3rGetHexagonEdgeLengthAvg(SEXP res, int distType);
162+
SEXP h3rGetHexagonEdgeLengthAvgM(SEXP res);
163+
SEXP h3rGetHexagonEdgeLengthAvgKm(SEXP res);
164+
165+
SEXP h3rEdgeLength(SEXP edge, int distType);
166+
SEXP h3rEdgeLengthRads(SEXP edge);
167+
SEXP h3rEdgeLengthM(SEXP edge);
168+
SEXP h3rEdgeLengthKm(SEXP edge);
169+
170+
SEXP h3rGetNumCells(SEXP res);
171+
SEXP h3rGetRes0Cells(void);
172+
SEXP h3rRes0CellCount(void);
173+
174+
SEXP h3rGetPentagons(SEXP res);
175+
SEXP h3rPentagonCount(void);
176+
177+
SEXP h3rGreatCircleDistance(SEXP aLats, SEXP aLons, SEXP bLats, SEXP bLons, int distType);
178+
SEXP h3rGreatCircleDistanceRads(SEXP aLats, SEXP aLons, SEXP bLats, SEXP bLons);
179+
SEXP h3rGreatCircleDistanceM(SEXP aLats, SEXP aLons, SEXP bLats, SEXP bLons);
180+
SEXP h3rGreatCircleDistanceKm(SEXP aLats, SEXP aLons, SEXP bLats, SEXP bLons);
181+
182+
#ifdef __cplusplus
183+
}
184+
#endif
185+
186+
#endif

inst/include/h3rapi.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12

23
#ifndef R_H3R_API_H
34
#define R_H3R_API_H

src/Makevars

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PKG_CPPFLAGS = -I../inst/include

src/Makevars.win

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PKG_CPPFLAGS = -I../inst/include

src/h3r.h

-102
This file was deleted.

0 commit comments

Comments
 (0)