|
1 | 1 |
|
2 | | -R version 4.0.4 (2021-02-15) -- "Lost Library Book" |
3 | | -Copyright (C) 2021 The R Foundation for Statistical Computing |
| 2 | +R version 4.2.3 (2023-03-15) -- "Shortstop Beagle" |
| 3 | +Copyright (C) 2023 The R Foundation for Statistical Computing |
4 | 4 | Platform: x86_64-pc-linux-gnu (64-bit) |
5 | 5 |
|
6 | 6 | R is free software and comes with ABSOLUTELY NO WARRANTY. |
@@ -84,29 +84,9 @@ MULTIPOINT ((1 3)) |
84 | 84 | MULTIPOINT ((10 13)) |
85 | 85 | MULTIPOINT ((11 14)) |
86 | 86 | MULTIPOINT ((12 15)) |
87 | | -> (yy = st_cast(pt, "LINESTRING", rep(seq_along(i), i))) |
88 | | -Geometry set for 5 features |
89 | | -Geometry type: LINESTRING |
90 | | -Dimension: XY |
91 | | -Bounding box: xmin: 0 ymin: 2 xmax: 12 ymax: 15 |
92 | | -CRS: NA |
93 | | -LINESTRING (0 2) |
94 | | -LINESTRING (1 3) |
95 | | -LINESTRING (10 13) |
96 | | -LINESTRING (11 14) |
97 | | -LINESTRING (12 15) |
| 87 | +> try(yy <- st_cast(pt, "LINESTRING", rep(seq_along(i), i))) |
98 | 88 | > |
99 | | -> (zz = st_cast(yy, "MULTILINESTRING")) |
100 | | -Geometry set for 5 features |
101 | | -Geometry type: MULTILINESTRING |
102 | | -Dimension: XY |
103 | | -Bounding box: xmin: 0 ymin: 2 xmax: 12 ymax: 15 |
104 | | -CRS: NA |
105 | | -MULTILINESTRING ((0 2)) |
106 | | -MULTILINESTRING ((1 3)) |
107 | | -MULTILINESTRING ((10 13)) |
108 | | -MULTILINESTRING ((11 14)) |
109 | | -MULTILINESTRING ((12 15)) |
| 89 | +> #(zz = st_cast(yy, "MULTILINESTRING")) |
110 | 90 | > #(zz = st_cast(yy, "POLYGON")) |
111 | 91 | > |
112 | 92 | > st_cast(mls, "LINESTRING") |
@@ -235,6 +215,24 @@ POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0), (5 5, 5 6, 6 6, 6 5, 5 5)) |
235 | 215 | > identical(m$geom[[1]], st_cast(g$geom[[1]], "MULTILINESTRING")) |
236 | 216 | [1] TRUE |
237 | 217 | > |
| 218 | +> st_cast(st_sfc(st_geometrycollection(), st_multipolygon()), 'MULTIPOLYGON') #1961 |
| 219 | +Geometry set for 2 features (with 2 geometries empty) |
| 220 | +Geometry type: MULTIPOLYGON |
| 221 | +Dimension: XY |
| 222 | +Bounding box: xmin: NA ymin: NA xmax: NA ymax: NA |
| 223 | +CRS: NA |
| 224 | +MULTIPOLYGON EMPTY |
| 225 | +MULTIPOLYGON EMPTY |
| 226 | +> st_cast(st_sfc(st_geometrycollection(), st_multipolygon(), st_point(0:1)), 'POINT') #1961 |
| 227 | +Geometry set for 3 features (with 2 geometries empty) |
| 228 | +Geometry type: POINT |
| 229 | +Dimension: XY |
| 230 | +Bounding box: xmin: 0 ymin: 1 xmax: 0 ymax: 1 |
| 231 | +CRS: NA |
| 232 | +POINT EMPTY |
| 233 | +POINT EMPTY |
| 234 | +POINT (0 1) |
| 235 | +> |
238 | 236 | > proc.time() |
239 | 237 | user system elapsed |
240 | | - 0.937 0.044 0.974 |
| 238 | + 1.501 0.751 1.420 |
0 commit comments