Closed paleolimbot closed 11 months ago
@edzer Is there somewhere that attr(some_sfc, "classes")
is documented? The issue is that wk is generating it improperly (which I should fix). If I understand it correctly, it should be a character vector with the same length as some_sfc
as a cache of class(some_sfc[[i]])
for i in seq_along(some_sfc)
?
Not documented (good point!) - sfc_GEOMETRY
objects need to have it, and it contains the middle (second) value of the class of an sfg
object:
> st_sfc(st_point(0:1), st_linestring(matrix(1:4,2))) |> attr("classes")
[1] "POINT" "LINESTRING"
AFAICS it's only used when converting to WKB.
All modified lines are covered by tests :white_check_mark:
Comparison is base (
e244165
) 99.02% compared to head (f70b650
) 99.02%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The change here is still not quite right yet...it's supposed to be the same length as the vector, not just the unique classes of the geometries.
May fix https://github.com/r-spatial/sf/issues/2234 if done correctly!