Skip to content

Commit 8dbd305

Browse files
author
Dewey Dunnington
authored
Merge pull request #114 from r-spatial/dewey-dev
`s2_cell()` vector class
2 parents f06f291 + f84c372 commit 8dbd305

File tree

14 files changed

+2173
-1
lines changed

14 files changed

+2173
-1
lines changed

NAMESPACE

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
# Generated by roxygen2: do not edit by hand
22

33
S3method("[",s2_xptr)
4+
S3method("[<-",s2_cell)
45
S3method("[<-",s2_geography)
56
S3method("[<-",s2_lnglat)
67
S3method("[<-",s2_point)
78
S3method("[[",s2_xptr)
9+
S3method("[[<-",s2_cell)
810
S3method("[[<-",s2_geography)
911
S3method("[[<-",s2_lnglat)
1012
S3method("[[<-",s2_point)
13+
S3method(Math,s2_cell)
14+
S3method(Ops,s2_cell)
15+
S3method(Summary,s2_cell)
16+
S3method(as.character,s2_cell)
1117
S3method(as.character,s2_geography)
1218
S3method(as.data.frame,s2_lnglat)
1319
S3method(as.data.frame,s2_point)
1420
S3method(as.data.frame,s2_xptr)
1521
S3method(as.matrix,s2_lnglat)
1622
S3method(as.matrix,s2_point)
23+
S3method(as_s2_cell,character)
24+
S3method(as_s2_cell,s2_cell)
25+
S3method(as_s2_cell,s2_geography)
26+
S3method(as_s2_cell,s2_lnglat)
27+
S3method(as_s2_cell,s2_point)
1728
S3method(as_s2_geography,WKB)
1829
S3method(as_s2_geography,blob)
1930
S3method(as_s2_geography,character)
@@ -39,23 +50,52 @@ S3method(as_wkb,s2_lnglat)
3950
S3method(as_wkt,s2_geography)
4051
S3method(as_wkt,s2_lnglat)
4152
S3method(c,s2_xptr)
53+
S3method(format,s2_cell)
4254
S3method(format,s2_geography)
4355
S3method(format,s2_lnglat)
4456
S3method(format,s2_point)
57+
S3method(is.na,s2_cell)
58+
S3method(is.numeric,s2_cell)
4559
S3method(print,s2_xptr)
4660
S3method(rep,s2_xptr)
4761
S3method(rep_len,s2_xptr)
62+
S3method(sort,s2_cell)
4863
S3method(str,s2_xptr)
64+
S3method(unique,s2_cell)
65+
export(as_s2_cell)
4966
export(as_s2_geography)
5067
export(as_s2_lnglat)
5168
export(as_s2_point)
69+
export(new_s2_cell)
5270
export(s2_area)
5371
export(s2_as_binary)
5472
export(s2_as_text)
5573
export(s2_boundary)
5674
export(s2_bounds_cap)
5775
export(s2_bounds_rect)
5876
export(s2_buffer_cells)
77+
export(s2_cell)
78+
export(s2_cell_area)
79+
export(s2_cell_area_approx)
80+
export(s2_cell_boundary)
81+
export(s2_cell_center)
82+
export(s2_cell_child)
83+
export(s2_cell_contains)
84+
export(s2_cell_debug_string)
85+
export(s2_cell_distance)
86+
export(s2_cell_edge_neighbour)
87+
export(s2_cell_invalid)
88+
export(s2_cell_is_face)
89+
export(s2_cell_is_leaf)
90+
export(s2_cell_is_valid)
91+
export(s2_cell_level)
92+
export(s2_cell_max_distance)
93+
export(s2_cell_may_intersect)
94+
export(s2_cell_parent)
95+
export(s2_cell_polygon)
96+
export(s2_cell_sentinel)
97+
export(s2_cell_to_lnglat)
98+
export(s2_cell_vertex)
5999
export(s2_centroid)
60100
export(s2_centroid_agg)
61101
export(s2_closest_edges)

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# s2 (development version)
22

3+
* Added an `s2_cell()` vector class to expose a subset of the S2
4+
indexing system to R users (#85, #114).
35
* Added `s2_closest_edges()` to make k-nearest neighbours calculation
46
possible on the sphere (#111, #112).
57
* Added `s2_interpolate()`, `s2_interpolate_normalized()`,

R/RcppExports.R

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,134 @@ cpp_s2_bounds_rect <- function(geog) {
6969
.Call(`_s2_cpp_s2_bounds_rect`, geog)
7070
}
7171

72+
cpp_s2_cell_sentinel <- function() {
73+
.Call(`_s2_cpp_s2_cell_sentinel`)
74+
}
75+
76+
cpp_s2_cell_from_string <- function(cellString) {
77+
.Call(`_s2_cpp_s2_cell_from_string`, cellString)
78+
}
79+
80+
cpp_s2_cell_from_lnglat <- function(lnglat) {
81+
.Call(`_s2_cpp_s2_cell_from_lnglat`, lnglat)
82+
}
83+
84+
cpp_s2_cell_to_lnglat <- function(cellId) {
85+
.Call(`_s2_cpp_s2_cell_to_lnglat`, cellId)
86+
}
87+
88+
cpp_s2_cell_is_na <- function(cellIdVector) {
89+
.Call(`_s2_cpp_s2_cell_is_na`, cellIdVector)
90+
}
91+
92+
cpp_s2_cell_sort <- function(cellIdVector, decreasing) {
93+
.Call(`_s2_cpp_s2_cell_sort`, cellIdVector, decreasing)
94+
}
95+
96+
cpp_s2_cell_range <- function(cellIdVector, naRm) {
97+
.Call(`_s2_cpp_s2_cell_range`, cellIdVector, naRm)
98+
}
99+
100+
cpp_s2_cell_unique <- function(cellIdVector) {
101+
.Call(`_s2_cpp_s2_cell_unique`, cellIdVector)
102+
}
103+
104+
cpp_s2_cell_to_string <- function(cellIdVector) {
105+
.Call(`_s2_cpp_s2_cell_to_string`, cellIdVector)
106+
}
107+
108+
cpp_s2_cell_debug_string <- function(cellIdVector) {
109+
.Call(`_s2_cpp_s2_cell_debug_string`, cellIdVector)
110+
}
111+
112+
cpp_s2_cell_is_valid <- function(cellIdVector) {
113+
.Call(`_s2_cpp_s2_cell_is_valid`, cellIdVector)
114+
}
115+
116+
cpp_s2_cell_center <- function(cellIdVector) {
117+
.Call(`_s2_cpp_s2_cell_center`, cellIdVector)
118+
}
119+
120+
cpp_s2_cell_polygon <- function(cellIdVector) {
121+
.Call(`_s2_cpp_s2_cell_polygon`, cellIdVector)
122+
}
123+
124+
cpp_s2_cell_vertex <- function(cellIdVector, k) {
125+
.Call(`_s2_cpp_s2_cell_vertex`, cellIdVector, k)
126+
}
127+
128+
cpp_s2_cell_level <- function(cellIdVector) {
129+
.Call(`_s2_cpp_s2_cell_level`, cellIdVector)
130+
}
131+
132+
cpp_s2_cell_area <- function(cellIdVector) {
133+
.Call(`_s2_cpp_s2_cell_area`, cellIdVector)
134+
}
135+
136+
cpp_s2_cell_area_approx <- function(cellIdVector) {
137+
.Call(`_s2_cpp_s2_cell_area_approx`, cellIdVector)
138+
}
139+
140+
cpp_s2_cell_parent <- function(cellIdVector, level) {
141+
.Call(`_s2_cpp_s2_cell_parent`, cellIdVector, level)
142+
}
143+
144+
cpp_s2_cell_child <- function(cellIdVector, k) {
145+
.Call(`_s2_cpp_s2_cell_child`, cellIdVector, k)
146+
}
147+
148+
cpp_s2_cell_edge_neighbour <- function(cellIdVector, k) {
149+
.Call(`_s2_cpp_s2_cell_edge_neighbour`, cellIdVector, k)
150+
}
151+
152+
cpp_s2_cell_cummax <- function(cellIdVector) {
153+
.Call(`_s2_cpp_s2_cell_cummax`, cellIdVector)
154+
}
155+
156+
cpp_s2_cell_cummin <- function(cellIdVector) {
157+
.Call(`_s2_cpp_s2_cell_cummin`, cellIdVector)
158+
}
159+
160+
cpp_s2_cell_eq <- function(cellIdVector1, cellIdVector2) {
161+
.Call(`_s2_cpp_s2_cell_eq`, cellIdVector1, cellIdVector2)
162+
}
163+
164+
cpp_s2_cell_neq <- function(cellIdVector1, cellIdVector2) {
165+
.Call(`_s2_cpp_s2_cell_neq`, cellIdVector1, cellIdVector2)
166+
}
167+
168+
cpp_s2_cell_lt <- function(cellIdVector1, cellIdVector2) {
169+
.Call(`_s2_cpp_s2_cell_lt`, cellIdVector1, cellIdVector2)
170+
}
171+
172+
cpp_s2_cell_lte <- function(cellIdVector1, cellIdVector2) {
173+
.Call(`_s2_cpp_s2_cell_lte`, cellIdVector1, cellIdVector2)
174+
}
175+
176+
cpp_s2_cell_gte <- function(cellIdVector1, cellIdVector2) {
177+
.Call(`_s2_cpp_s2_cell_gte`, cellIdVector1, cellIdVector2)
178+
}
179+
180+
cpp_s2_cell_gt <- function(cellIdVector1, cellIdVector2) {
181+
.Call(`_s2_cpp_s2_cell_gt`, cellIdVector1, cellIdVector2)
182+
}
183+
184+
cpp_s2_cell_contains <- function(cellIdVector1, cellIdVector2) {
185+
.Call(`_s2_cpp_s2_cell_contains`, cellIdVector1, cellIdVector2)
186+
}
187+
188+
cpp_s2_cell_may_intersect <- function(cellIdVector1, cellIdVector2) {
189+
.Call(`_s2_cpp_s2_cell_may_intersect`, cellIdVector1, cellIdVector2)
190+
}
191+
192+
cpp_s2_cell_distance <- function(cellIdVector1, cellIdVector2) {
193+
.Call(`_s2_cpp_s2_cell_distance`, cellIdVector1, cellIdVector2)
194+
}
195+
196+
cpp_s2_cell_max_distance <- function(cellIdVector1, cellIdVector2) {
197+
.Call(`_s2_cpp_s2_cell_max_distance`, cellIdVector1, cellIdVector2)
198+
}
199+
72200
cpp_s2_geog_point <- function(x, y) {
73201
.Call(`_s2_cpp_s2_geog_point`, x, y)
74202
}

0 commit comments

Comments
 (0)