This matters most at high latitudes, where the width of a cell changes most, and can be different between the bottom and the top of a cell. terra is more precise, it computes the spherical area of a cell (as defined by its four corners). Raster uses the product of the width (longitude) and height (latitude) of a cell. I am assuming that the area estimates provided by terra::cellSize() (or terra::expanse(), for that matter) are more accurate than raster::area(), but I'd love to know more about what changed before I update previous area estimates. I have been using raster (and loving it) for the last few years, and have recently been blown away by the speed and other improvements provided by the newer terra package. #> loaded via a namespace (and not attached): #> stats graphics grDevices utils datasets methods base #> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib #> BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib # note that this terra workflow yields the same answer as terra::expanse() I just noticed that terra::cellSize() produces cell area estimates that do not match those produced by raster::area().įirst, why do these two methods not provide the same answer? Second, which estimate is most accurate? See example below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |