Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 r 中的 shapefile 作为 shapefile 的形状来剪辑栅格。我使用了裁剪功能,但它裁剪为范围而不是形状。请帮我
裁剪,如手册页中所述,裁剪到对象的范围,为您的目的,您可以使用raster::mask(),具有与裁剪掩码函数相同的语法“创建一个与 x 具有相同值的新 Raster* 对象,除了“掩码”中为 NA(或其他掩码值)的单元格。” 您可以通过inverse=T,以便从 spatialPolygon 中获取这些值。
raster::mask()
inverse=T