Search code examples
rgisrasterr-rastermap-projections

Raster reprojection to latlon changes values


I start with the following Raster:

class      : RasterLayer 
dimensions : 900, 900, 810000  (nrow, ncol, ncell)
resolution : 1, 1  (x, y)
extent     : -523.4622, 376.5378, -4658.645, -3758.645  (xmin, xmax, ymin, ymax)
crs        : +proj=stere +lat_0=90 +lon_0=10 +k=0.93301270189 +x_0=0 +y_0=0 +ellps=WGS84 +units=km +no_defs 
source     : memory
names      : layer 
values     : 0, 2500  (min, max)

If i reproject this raster to latlon with:

  raster_projection <- projectRaster(rb, crs = "+proj=longlat +datum=WGS84 +no_defs")

it creates a reprojection with significant shift in data:

class      : RasterLayer 
dimensions : 944, 1014, 957216  (nrow, ncol, ncell)
resolution : 0.0136, 0.00857  (x, y)
extent     : 2.00348, 15.79388, 46.99609, 55.08617  (xmin, xmax, ymin, ymax)
crs        : +proj=longlat +datum=WGS84 +no_defs 
source     : memory
names      : layer 
values     : -0.6159579, 3583.708  (min, max)

I think the data points are so to say: "too far up".

Is this to be expected?

How can i create a reprojection that is more true to original ?

Thank you!


Solution

  • The new extreme values are likely at the edges; and so your problem may be caused by a few cells. A more appropriate comparison could be to look at a boxplot or quantiles. You could also use terra::project instead. I think that method is less prone to this.