ropensci / rnaturalearth

An R package to hold and facilitate interaction with natural earth map data :earth_africa:
http://ropensci.github.io/rnaturalearth/
Other
214 stars 24 forks source link

'ne_download': add 'sv' (SpatVector) to 'returnclass' options #49

Closed AMBarbosa closed 7 months ago

AMBarbosa commented 2 years ago

The 'terra' package is becoming widey used and it replaces not only 'raster' but also 'sp' (and 'rgdal'). So, it would be highly relevant to add the 'SpatVector' class to the ne_download 'returnclass' options, and eventually even have it replace the default 'sp' class when it becomes obsolete. Cheers!

PMassicotte commented 1 year ago

rnaturalearth is now using SpatRaster as implemented in v3.2.0 (#63).

r$> ne_download(scale = 50, type = "MSR_50M", category = "raster")
trying URL 'https://naturalearth.s3.amazonaws.com/50m_raster/MSR_50M.zip'
Content type 'application/zip' length 17984241 bytes (17.2 MB)
==================================================
downloaded 17.2 MB

class       : SpatRaster 
dimensions  : 5400, 10800, 1  (nrow, ncol, nlyr)
resolution  : 0.03333333, 0.03333333  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : lon/lat WGS 84 (EPSG:4326) 
source      : MSR_50M.tif 
name        : MSR_50M 

Maybe add a new option returnclass = "sv" for SpatVec?

AMBarbosa commented 1 year ago

yes please, that would be great