You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to #89, it became possible to use an sf object with ext, rast, crop, extract and rasterize, which was a useful improvement. I recently encountered the following error, which suggests that sf objects are no longer supported by rasterize, at least :
library(terra)
# terra 1.7.18
library(sf)
# Linking to GEOS 3.9.3, GDAL 3.5.2, PROJ 8.2.1; sf_use_s2() is TRUE
f <- system.file("ex/lux.shp", package="terra")
According to https://github.com/rspatial/terra/issues/89, it was now possible to use an `sf` object with `ext`, `rast`, `crop`, `extract` and `rasterize`, which was usefull
vSf <- st_read(f)
# Reading layer `lux' from data source
# `C:\Users\jldupouey\AppData\Local\R\win-library\4.2\terra\ex\lux.shp'
# using driver `ESRI Shapefile'
# Simple feature collection with 12 features and 6 fields
# Geometry type: POLYGON
# Dimension: XY
# Bounding box: xmin: 5.74414 ymin: 49.44781 xmax: 6.528252 ymax: 50.18162
# Geodetic CRS: WGS 84
r <- rast(v, ncols=75, nrows=100)
z <- rasterize(vSf, r, "NAME_2")
# Error in get(as.character(FUN), mode = "function", envir = envir) :
# object 'fun' of mode 'function' was not found
The text was updated successfully, but these errors were encountered:
According to #89, it became possible to use an
sf
object withext
,rast
,crop
,extract
andrasterize
, which was a useful improvement. I recently encountered the following error, which suggests thatsf
objects are no longer supported byrasterize
, at least :The text was updated successfully, but these errors were encountered: