Closed mhesselbarth closed 2 months ago
Here are the files
> all.equal(st_dimensions(x1), st_dimensions(x2))
[1] "Component “x”: Component “refsys”: Component “input”: 1 string mismatch"
[2] "Component “y”: Component “refsys”: Component “input”: 1 string mismatch"
> all.equal(st_dimensions(x2), st_dimensions(x3))
[1] TRUE
Thanks for the quick reply. So there seems to be a small difference of the CRS? Because on the first glance they all seem to be ETRS89
.
Yes, and they're semantically equivalent:
> st_crs(x1) == st_crs(x2)
[1] TRUE
so there is room for improving this; for now you could
st_crs(x1) = st_crs(x2)
i.e. copy it over to ensure equality, and then c(x1,x2)
but I'd agree that is not elegant. There must be a reason however, that they're different in the first place, you could try to catch that earlier.
Perfect that helps me a lot. Thank you very much.
I suspect it’s happening because I set the crs for one object using the epsg code and for one using an existing object.
Hello,
I am currently trying to
c()
two objects (x1
andx2
) which have the same dimensions. I would like to combine the attributes and keep the dimensions. However, I am getting an error the stars don't know how to merge them.However, the same code works for a different, similar objects (
x2
andx3
)Created on 2024-08-23 with reprex v2.1.1
Thanks for the help!