Commit 36fc15b 1 parent 0410cb8 commit 36fc15b Copy full SHA for 36fc15b
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 18
18
} else {
19
19
# create a sf of points
20
20
epsg_lst <- unique(s2_tb [[" epsg" ]])
21
- points_sf <- sf :: st_cast (.map_dfr(epsg_lst , function (epsg ) {
21
+ points_sf <- sf :: st_as_sf (.map_dfr(epsg_lst , function (epsg ) {
22
22
tiles <- dplyr :: filter(s2_tb , epsg == {{epsg }})
23
23
sfc <- matrix (c(tiles [[" xmin" ]], tiles [[" ymin" ]]), ncol = 2 ) | >
24
24
sf :: st_multipoint(dim = " XY" ) | >
25
25
sf :: st_sfc(crs = epsg ) | >
26
26
sf :: st_transform(crs = " EPSG:4326" )
27
27
sf :: st_sf(geom = sfc )
28
- }), " POINT " )
29
-
28
+ }))
29
+ points_sf <- sf :: st_cast( points_sf , " POINT " )
30
30
# change roi to 1.5 degree to west and south
31
31
roi_search <- .bbox_as_sf(
32
32
dplyr :: mutate(
58
58
})
59
59
60
60
# transform each sf to WGS84 and merge them into a single one sf object
61
- s2_tiles <- .map_dfr(s2_sf_lst , function (s2_sf ) {
61
+ s2_tiles <- sf :: st_as_sf( .map_dfr(s2_sf_lst , function (s2_sf ) {
62
62
s2_sf <- sf :: st_as_sf(
63
63
x = s2_sf ,
64
64
sf_column_name = " geom" ,
68
68
x = sf :: st_segmentize(s2_sf , 10980 ),
69
69
crs = " EPSG:4326"
70
70
)
71
- })
71
+ }))
72
72
73
73
# if roi is given, filter tiles by desired roi
74
74
if (.has(roi ))
You can’t perform that action at this time.
0 commit comments