如何使用不同的投影同步栅格

时间:2014-06-22 15:12:22

标签: r raster map-projections

我想同步两个不同程度和不同投影系统的geotiff文件。我尝试使用spatial_sync_raster,但它没有用。我应该怎么做 ?以下是该文件的详细信息。

class       : RasterLayer 
band        : 1  (of  3  bands)
dimensions  : 480, 480, 230400  (nrow, ncol, ncell)
resolution  : 1, 1  (x, y)
extent      : 0, 480, 0, 480  (xmin, xmax, ymin, ymax)
coord. ref. : NA 
data source : D:\Test R\preqies\lc_2005.tif 
names       : lc_2005 
values      : 0, 255  (min, max)

class       : RasterLayer 
dimensions  : 869, 1201, 1043669  (nrow, ncol, ncell)
resolution  : 100, 100  (x, y)
extent      : 771507.8, 891607.8, 9788643, 9875543  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 
data source : D:\Test R\preqies\lc_2010.tif 
names       : lc_2010 
values      : 1, 22  (min, max)

尝试此代码时出现错误

 landuse2<-spatial_sync_raster(landuse2, landuse1, method = "ngb")

**Error in rawTransform(projfrom, projto, nrow(xy), xy[, 1], xy[, 2]) : 
  no arguments in initialization list**

任何人都可以告诉我,是什么部分让我的代码无效?感谢

1 个答案:

答案 0 :(得分:1)

尝试添加相同的投影:

projection(landuse2)<- "+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84"

landuse2<-spatial_sync_raster(landuse2, landuse1, method = "ngb")

我有同样的问题,我解决了这个问题。运气

相关问题