Skip to main content
Post Reopened by Kadir Şahbaz, TomazicM, tinlyx, MrXsquared, PolyGeo
added 11 characters in body
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error. The R code is here: library(raster) merge_forest <- raster::merge(f1,f2,f3,f4,f5,f6,f7,tolerance=0.1)

library(raster)
merge_forest <- raster::merge(f1,f2,f3,f4,f5,f6,f7,tolerance=0.1)

These are the raster tiles of landcover(https://www.arcgis.com/apps/instant/media/index.html?appid=fc92d38533d440078f17678ebc20e8e2&fbclid=IwAR3Y3SN7iyaPrzViPzagVH086dZTygvmwoIdZrudbb4EJlJyZOf6zdA13g4). 

I downloaded seven tiles that covers the area of Norway and wanted to merge it together and clip it to the extent of Norway.

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error. The R code is here: library(raster) merge_forest <- raster::merge(f1,f2,f3,f4,f5,f6,f7,tolerance=0.1)

These are the raster tiles of landcover(https://www.arcgis.com/apps/instant/media/index.html?appid=fc92d38533d440078f17678ebc20e8e2&fbclid=IwAR3Y3SN7iyaPrzViPzagVH086dZTygvmwoIdZrudbb4EJlJyZOf6zdA13g4). I downloaded seven tiles that covers the area of Norway and wanted to merge it together and clip it to the extent of Norway.

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error. The R code is here:

library(raster)
merge_forest <- raster::merge(f1,f2,f3,f4,f5,f6,f7,tolerance=0.1)

These are the raster tiles of landcover(https://www.arcgis.com/apps/instant/media/index.html?appid=fc92d38533d440078f17678ebc20e8e2&fbclid=IwAR3Y3SN7iyaPrzViPzagVH086dZTygvmwoIdZrudbb4EJlJyZOf6zdA13g4). 

I downloaded seven tiles that covers the area of Norway and wanted to merge it together and clip it to the extent of Norway.

added 438 characters in body
Source Link

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error. The R code is here: library(raster) merge_forest <- raster::merge(f1,f2,f3,f4,f5,f6,f7,tolerance=0.1)

These are the raster tiles of landcover(https://www.arcgis.com/apps/instant/media/index.html?appid=fc92d38533d440078f17678ebc20e8e2&fbclid=IwAR3Y3SN7iyaPrzViPzagVH086dZTygvmwoIdZrudbb4EJlJyZOf6zdA13g4). I downloaded seven tiles that covers the area of Norway and wanted to merge it together and clip it to the extent of Norway.

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error.

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error. The R code is here: library(raster) merge_forest <- raster::merge(f1,f2,f3,f4,f5,f6,f7,tolerance=0.1)

These are the raster tiles of landcover(https://www.arcgis.com/apps/instant/media/index.html?appid=fc92d38533d440078f17678ebc20e8e2&fbclid=IwAR3Y3SN7iyaPrzViPzagVH086dZTygvmwoIdZrudbb4EJlJyZOf6zdA13g4). I downloaded seven tiles that covers the area of Norway and wanted to merge it together and clip it to the extent of Norway.

Post Closed as "Needs details or clarity" by Spacedman, Kadir Şahbaz, Cyril Mikhalchenko, PolyGeo
edited body; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Merging raster in R version 4.0.3

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error.

Thank you.

Merging raster in R version 4.0.3

I am trying to merge seven tiles of raster in R but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error.

Thank you.

Merging raster in R

I am trying to merge seven tiles of raster in R version 4.0.3 but it shows error as:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  : 
  different origin.

The origin of raster are:

> origin(f1)
[1] 1.549293 0.000000
> origin(f2)
[1] 1.666904 2.306145
> origin(f3)
[1]  0.02155916 -0.67734774
> origin(f4)
[1] 2.921843 4.800345
> origin(f5)
[1] -2.036317 -1.870532
> origin(f6)
[1] 3.293903 4.393251
> origin(f7)
[1] -0.3293477 -0.2457405

and I tried tolerance=0.1 but its still showing the same error.

Its **R** version 4.0.3, not RStudio.
Source Link
Spacedman
  • 66.5k
  • 6
  • 83
  • 121
Loading
Source Link
Loading