【问题标题】:How to sync rasters with different projections如何同步具有不同投影的栅格
【发布时间】:2014-06-22 15:12:21
【问题描述】:

我想同步两个不同范围和不同投影系统的 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**

谁能告诉我,是什么让我的代码不起作用?谢谢

【问题讨论】:

    标签: r raster map-projections


    【解决方案1】:

    尝试添加相同的投影:

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

    我遇到了同样的问题,我解决了这个案子。运气

    【讨论】:

      猜你喜欢
      • 2013-10-19
      • 2018-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-23
      • 2014-05-30
      • 1970-01-01
      • 2019-05-01
      相关资源
      最近更新 更多