Migrate from raster to terra
Given the encouragement by package maintainers for everyone to migrate from raster to terra, I thought it may be helpful to make this change for mapboxapi.
I already was able to replace raster functions with the terra versions for layer_static_mapbox() and tm_static_mapbox(). The only other using raster is get_static_tiles() which is a bit more complicated. It looks like ceramic (which you cite as the source for code that was adapted and incorporated into the function) has also already migrated to terra so I think it shouldn't be too difficult to figure out based on this updated code: https://github.com/hypertidy/ceramic/blob/f228ea6e5842cb55cafa413bdcb921b36047849a/R/get_tiles.R
If you wanted to tackle the latter changes to get_static_tiles() yourself, I'm happy to open a pull request for the other changes. If not, I'd be happy to figure it out sometime in the next couple weeks.
Happy to see #40 merged! I did want to flag that while I had started substituting {RcppSimdJson} for {jsonlite}, I didn't quite finish that change. It also might be worth looking at the new {yyjsonr} package: https://github.com/coolbutuseless/yyjsonr Either way it is low priority and not directly related to the raster to terra migration.
Still happy to revisit Michael Sumner's code in ceramic later this fall to see if I can figure out the needed changes to get_static_tiles().
yeah I'm noticing some breakages there, I'm going to revert back to jsonlite.
Sorry @elipousson - I noticed this PR broke several functions as I was testing so I needed to revert. Let's review piece-by-piece; I think removing jsonlite introduced several problems (particularly with the navigation functions).
No apologies needed—my fault for not keeping the pull request clean. Have you considered expanding the tests in testthat and adding some code coverage checks to the repository? It seems helpful for other packages I've contributed to.
Would you suggest opening a new pull request just focused on removing the raster dependency from static_mapbox() to start, @walkerke?
Would you suggest opening a new pull request just focused on removing the raster dependency from
static_mapbox()to start, @walkerke?
Yes I think that'd be good! We can then consider the JSON stuff at a later date (I've seen a few posts about issues people have had with RcppSimdJson).