-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cannot use sf
object as loc
argument
#40
Comments
yeh, I'm afraid it's very difficult to get a basic extent and crs for use for transforming with these big player packages ... the core problem is the I'd recommend just using a raster extent in longlat if you have trouble with sf objects, something like
that will be pretty reliable (we don't need sub-metre accuracy for a basic extent to get a rough area ... Concretely: map.nc = cc_location(loc = raster::extent(sf::st_transform(nc, 4326)), buffer = 1e8,
base_url = "https://api.mapbox.com/styles/v1/mapbox/light-v10/tiles/{zoom}/{x}/{y}")
that redundantly attempts transformation "longlat" (different datum but no one cares at this scale), but for general sf objects will also work because ceramic can guess well enough from longlat data. Unless you have tricky polar regions or very weird projections you should be fine in most places. HTH, and sorry there's no obvious fix - I'll have a think about where this goes but there is no fundamental support for these basic shared things for dev sad to say. |
Hey @mdsumner, thanks so much for taking the time to answer so thoroughly! Thanks as well for the fix, looks way better than my own terrible hack (getting the center of the |
I guess this is related: I just suppressed warnings in the slopes package, which auto gets elevations thanks to this great package. In case it's of use/interesting, and in case I'm doing something wrong! ropensci/slopes#37 |
I think I've fixed this, raster::projection now returns those weird strings that only work in some situations - in this case it's "NAD27" so I catch it. |
Hi and thanks for the great package.
I used to use
sf
objects asloc
arguments inside thecc_location
method, but it does not seem to work this time around. The method still works when feeding a point as argument, though. Below is areprex
of the issue. Not sure what is going on with theproj4::ptransform
error, any clues?Created on 2021-06-28 by the reprex package (v2.0.0)
The text was updated successfully, but these errors were encountered: