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
Are there capable options for selecting more than one attribute in the fasterize package? or
Is there an efficient method for selecting multiple fields when the raster used in fasterize does not have an attribute table, such that the attribute values are taken from the columns in the shapefile?
For example, when using rasterize, it automatically selects all the attributes, i.e.
I've noticed that the attributes are credited to the raster if and only if attributes are currently present in the fasterized raster, though this is not necessarily true for rasterize.
Though, when r has an attribute table, then fasterize imitates it:
#This is the result when I use r.2010, the first example above, as the raster to be fasterized
class : RasterLayer
dimensions : 1405, 1943, 2729915 (nrow, ncol, ncell)
resolution : 2316.564, 2316.564 (x, y)
extent : -9738370, -5237287, 2741885, 5996656 (xmin, xmax, ymin, ymax)
crs : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +R=6371007.181 +units=m +no_defs
source : memory
names : layer
values : 1, 1 (min, max)
attributes :
ID year locality_id species_observed
from: 1 2010 L2228604 0
to : 28289 2010 L1348755 0
Though, if I wish to select a field, I can alternatively select individual fields likeso:
fasterize(r, field = "some_field")
Although, I cannot select multiple fields
fasterize(r, field = c("some_field_1", "some_field_2"))
Error in fasterize(., r.2019, field = c("some_field_1", "some_field_2")) :
Expecting a single string value: [type=character; extent=2].
The text was updated successfully, but these errors were encountered:
Are there capable options for selecting more than one attribute in the
fasterize
package? orIs there an efficient method for selecting multiple fields when the raster used in
fasterize
does not have an attribute table, such that the attribute values are taken from the columns in the shapefile?For example, when using
rasterize
, it automatically selects all the attributes, i.e.Though, when using fasterize, it returns a field of 1:
I've noticed that the attributes are credited to the raster if and only if attributes are currently present in the fasterized raster, though this is not necessarily true for rasterize.
i.e.
Though, when
r
has an attribute table, then fasterize imitates it:Though, if I wish to select a field, I can alternatively select individual fields likeso:
Although, I cannot select multiple fields
The text was updated successfully, but these errors were encountered: