相关疑难解决方法(0)

在R中将Shapefile转换为光栅?

我有一个从worldwildlife.org下载的shapefile,用于世界地球生态区.该文件可以在这里加载:http://worldwildlife.org/publications/terrestrial-ecoregions-of-the-world.

它是一个标准的形状文件,我想用它做两件事.首先:从我的本地目录中获取shapefile并将其剪辑到北美东部(ext = extent(-95,-50,24,63))

# Read shapefile using package "maptools"
eco_shp <- readShapeLines("F:/01_2013/Ecoregions/Global/wwf_terr_ecos.shp", 
                          proj4string=CRS("+proj=utm +zone=33 +datum=WGS84")) 


# Set the desired extent for the final raster using package "raster" 
ext <- extent(-95, -50, 24, 63)
Run Code Online (Sandbox Code Playgroud)

我确信我必须在"raster"包中使用rasterize功能,但我仍然无法使其正常工作.我很感激有关如何做到这一点的任何建议.

r raster data-conversion shapefile rasterizing

8
推荐指数
1
解决办法
9672
查看次数

标签 统计

data-conversion ×1

r ×1

raster ×1

rasterizing ×1

shapefile ×1