This is a breaking changes release that ends support to sp
object in favour of more modern interfaces (sf
and terra
). Although that sp
is still available on CRAN, it is no longer being actively developed (https://geocompx.org/post/2023/rgdal-retirement/). This is the main reason that motivated the choice to transition toward sf
(the default) and terra
.
Users can choose either get an sf
or SpatVector
using the returnclass
argument:
ne_countries(returnclass = "sf")
ne_countries(returnclass = "sv")
Affected functions are ne_countries()
, ne_coastline()
, ne_states()
, ne_load()
and ne_download()
.
If changing the return type to sf
creates too many problems to your existing code, you can still convert it back to sp
:
countries <- ne_countries(returnclass = "sf")
# option 1
sf::as_Spatial(countries)
# option 2
as(countries, "Spatial")
More information about the retirement of rgdal
, rgeos
and maptools
: https://r-spatial.org/r/2022/04/12/evolution.html
Using lifecycle
to indicate that support of sp
object will be eventually dropped. Users should now use ne_download(returnclass = "sf")
, instead of ne_download(returnclass = "sp")
.
terra
is now included in the Imports section.
Using terra over raster (#63)
See https://r-spatial.org/r/2022/04/12/evolution.html#packages-depending-on-sp-and-raster and https://r-spatial.org/r/2022/12/14/evolution2.html#deprecations-in-retiring-packages
Fixes broken data download links.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.