“错误:继承(obj,”Spatial“)不为TRUE”

时间:2015-11-24 13:21:51

标签: raster r-raster

我想从下面的光栅对象(r1)创建轮廓线(50%,75%,95%),可以将其传输到ArcGIS。但我总是收到错误消息:“错误:继承(obj,”Spatial“)不是”。“

"abc0"

1 个答案:

答案 0 :(得分:0)

请尝试以下操作:

library(sp)
library(maptools)
l = quantile(r1[], c(.05, .5, .95))
sl = ContourLines2SLDF(contourLines(as.image.SpatialGridDataFrame(as(r1, "SpatialGridDataFrame")), levels = l))
library(rgdal)
writeOGR(sl, ".", paste("r1"), driver="ESRI Shapefile")