Hi all, I'm working with raster data (satellite imagery) and the raster package. The idea is to merge two raster files that are partially overlaping, do have the same coordinate system and resolution but not the same origin. As expected, the functions mosaic(r1,r2) as well as merge(r1,r2)) give the error message: Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE, : different origin> extent(r1)class : Extent xmin : 24.14369 xmax : 37.81287 ymin : -31.1356 ymax : -14.72525> extent(r2)class : Extent xmin : 26.80423 xmax : 42.15502 ymin : -19.33202 ymax : -7.643101> origin(r1)[1] 5.582522e-05 1.124150e-03> origin(r2)[1] 0.001054868 -0.001124150 Can anyone tell me how it is possible to merge rasters with different origin? Thanks in advance.
According to ?merge, you could try adjusting the default value of the "tolerance" argument. Nora Ernst wrote> I'm working with raster data (satellite imagery) and the raster package. > The > idea is to merge two raster files that are partially overlaping, do > have the > same coordinate system and resolution but not the same origin. As > expected, > the functions mosaic(r1,r2) as well as merge(r1,r2)) give the error > message: > > Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE, : > different origin > > >> origin(r1) > [1] 5.582522e-05 1.124150e-03 >> origin(r2) > [1] 0.001054868 -0.001124150 > > > Can anyone tell me how it is possible to merge rasters with different > origin?-- View this message in context: http://r.789695.n4.nabble.com/raster-package-merge-mosaic-tp4678890p4678899.html Sent from the R help mailing list archive at Nabble.com.