Closed loreabad6 closed 7 months ago
Hi @loreabad6,
1/2: thanks, I added additional tests for the cases you mentioned.
3: I realize the fail is because stopifnot
assumes long&lat are the coordinates and checks for that, but later codes only use coords()
to extract the coordinates, so a better check is to make sure that coords
is not null.
Thanks for the contribution!
Hi @huizezhang-sherry, I was playing a bit with the
as_cubble()
function to coerce stars objects to cubble and noted a couple of things.To coerce from a vector data cube the
sfc
dimension had to be the first dimension in the data cube. This is because of anif
check, so I think this could be safely replaced with a check over all dimensions and testing the condition as if any of the dimensions inheritssfc
.The raster data cube coercion assumes that time is the third dimension, but this is not always the case. In the example of the documentation, the band dimension is mistankenly taken as the time dimension. This creates the cubble correctly but trying to call
face_temporal()
for example, fails since it cannot find the time column in the data. I would think that letting the user define the time dimension would be cleaner and more straightforward. Maybe the examples need to be rethought since it does not make sense to add band as time, but it is theoretically possible to do so!Also, I was testing the
make_spatial_sf()
function and noticed that it fails if the lat/long columns are x/y, so I added a line to include that case as well.