R(GIS)中的大型.img文件处理

I D*_*oro 3 gis r

我正在与美国国家土地覆盖数据集(NLCD)合作,在美国东北部的150多个地点对栖息地类型进行分类.数据集非常大(15GB),因此我无法在此处上传,但它以30m分辨率的.img格式.我有所有站点中心点的GPS坐标.我希望能够提取1平方公里左右的土地覆盖类比例.我的问题是:

1)如何将.img文件上传到r?2)如何从GPS坐标周围提取信息作为不同栖息地类别的比例?

有没有人在r之前使用过这个数据集?如果是这样,我真的可以使用帮助.干杯,以色列

mne*_*nel 5

使用raster可以处理磁盘文件的包,一次只能读取块.

所述raster封装具有一个extract与一个函数buffer参数.将缓冲区设置为适当的值(1000如果您的地图单位是米,并且您想要一个km半径)


I D*_*oro 3

感谢米内尔。我已经掌握了工作的基本想法(代码如下)。现在,如果有人可以指导我如何计算每个坐标的每个类别的比例。该extract函数为我提供每组坐标的值矩阵。有没有办法总结这些数据?

#load in map and locality data
NLCD<-raster ('NLCD2006/NLCD2006.img')
sites<-read.csv('sites.csv', header=T)
#crop site data to just latitude and longitude
sites<-sites[,4:5]
#convert lat/lon to appropirate projection
str (sites)
coordinates(sites)  <-  c("Longitude",  "Latitude")
proj4string(sites)  <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")
sites_transformed<-spTransform(sites, CRS("+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"))

#plot the map
plot (NLCD)
#add the converted x y points
points (sites_transformed, pch=16, col="red", cex=.75)
#extract values to poionts
Landcover<-extract (NLCD, sites_transformed, buffer=1000)
Run Code Online (Sandbox Code Playgroud)