-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intermittent error converting sf
to SpatVector
#1098
Comments
This works if you load "sf" first
With the above I get
But if I do not run
And the coercion fails. Even though in both cases I get
|
This works, thanks! I was indeed using Thanks for all your work on this package! |
This now gives a clearer error message:
|
I use some
spData
objects as part of a workflow, including state shapes for cropping:states <- spData::us_states[which(spData::us_states$NAME %in% c('Colorado', 'Utah')), ]
Sometimes a direct conversion works with terra:
states <- terra::vect(states)
But lately its been giving me this error:
Error: [as,sf] coercion failed. You can try coercing via a Spatial* (sp) class
Using
as(states, 'Spatial')
also appears broken:Error in st_geometry.sf(from) : attr(obj, "sf_column") does not point to a geometry column. Did you rename it, without setting st_geometry(obj) <- "newname"?
Using R 4.2.2 with spData 2.2.2, sf 1.0-9, sp 1.6-0, terra 1.7-22
The text was updated successfully, but these errors were encountered: