Skip to main content
added 334 characters in body
Source Link

I am working with two rasters. I am trying to reproject r1 the same way as the raster r2. Rasters are available here

r1

class       : RasterLayer 
dimensions  : 30286, 58025, 1757345150  (nrow, ncol, ncell)
resolution  : 99.99876, 99.99876  (x, y)
extent      : -2893269, 2909160, 224962.6, 3253525  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 
values      : 0, 7 (min, max)

r2

class       : RasterLayer 
dimensions  : 585, 1386, 810810  (nrow, ncol, ncell)
resolution  : 0.04166599, 0.041666  (x, y)
extent      : 235.207, 292.9561, 25.04224, 49.41686  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +no_defs 
values      : -7.904284, 12.21496  (min, max)

I precise that the resolution of r1 is 100 m and the resolution of r2 is supposed to be 4km. Moreover, the system of coordinates is different as one is in degree and another one in meter. I would like to reproject the rasters in order they keep their own resolution and share the same extent.

I did not find a way to do it. When I upload my data in Arcgis, the rasters are aligned as I would like which is not the case with Qgis and R. The final goal would be to allow raster calculations by stacking the raster for example.

I do not want to reproject the raster from r2 to r1 as I am working with thousands of raster that have the same coordinates than r2.

I can work with Arcgis, Qgis, and R. However, I do not know how to code in Python.

Currently, by applying the method by Spacedman (answers below), I obtainedthis figure. This is much better as my rasters are closers but there are still not at the same position when I plot them. Moreover, the resolution of r1 has changed. I am confused to what is the problem.

I am working with two rasters. I am trying to reproject r1 the same way as the raster r2. Rasters are available here

r1

class       : RasterLayer 
dimensions  : 30286, 58025, 1757345150  (nrow, ncol, ncell)
resolution  : 99.99876, 99.99876  (x, y)
extent      : -2893269, 2909160, 224962.6, 3253525  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 
values      : 0, 7 (min, max)

r2

class       : RasterLayer 
dimensions  : 585, 1386, 810810  (nrow, ncol, ncell)
resolution  : 0.04166599, 0.041666  (x, y)
extent      : 235.207, 292.9561, 25.04224, 49.41686  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +no_defs 
values      : -7.904284, 12.21496  (min, max)

I precise that the resolution of r1 is 100 m and the resolution of r2 is supposed to be 4km. Moreover, the system of coordinates is different as one is in degree and another one in meter. I would like to reproject the rasters in order they keep their own resolution and share the same extent.

I did not find a way to do it. When I upload my data in Arcgis, the rasters are aligned as I would like which is not the case with Qgis and R. The final goal would be to allow raster calculations by stacking the raster for example.

I do not want to reproject the raster from r2 to r1 as I am working with thousands of raster that have the same coordinates than r2.

I can work with Arcgis, Qgis, and R. However, I do not know how to code in Python.

I am working with two rasters. I am trying to reproject r1 the same way as the raster r2. Rasters are available here

r1

class       : RasterLayer 
dimensions  : 30286, 58025, 1757345150  (nrow, ncol, ncell)
resolution  : 99.99876, 99.99876  (x, y)
extent      : -2893269, 2909160, 224962.6, 3253525  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 
values      : 0, 7 (min, max)

r2

class       : RasterLayer 
dimensions  : 585, 1386, 810810  (nrow, ncol, ncell)
resolution  : 0.04166599, 0.041666  (x, y)
extent      : 235.207, 292.9561, 25.04224, 49.41686  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +no_defs 
values      : -7.904284, 12.21496  (min, max)

I precise that the resolution of r1 is 100 m and the resolution of r2 is supposed to be 4km. Moreover, the system of coordinates is different as one is in degree and another one in meter. I would like to reproject the rasters in order they keep their own resolution and share the same extent.

I did not find a way to do it. When I upload my data in Arcgis, the rasters are aligned as I would like which is not the case with Qgis and R. The final goal would be to allow raster calculations by stacking the raster for example.

I do not want to reproject the raster from r2 to r1 as I am working with thousands of raster that have the same coordinates than r2.

I can work with Arcgis, Qgis, and R. However, I do not know how to code in Python.

Currently, by applying the method by Spacedman (answers below), I obtainedthis figure. This is much better as my rasters are closers but there are still not at the same position when I plot them. Moreover, the resolution of r1 has changed. I am confused to what is the problem.

Source Link

How to reproject a raster based on another raster when the datum is not said and get the same extent?

I am working with two rasters. I am trying to reproject r1 the same way as the raster r2. Rasters are available here

r1

class       : RasterLayer 
dimensions  : 30286, 58025, 1757345150  (nrow, ncol, ncell)
resolution  : 99.99876, 99.99876  (x, y)
extent      : -2893269, 2909160, 224962.6, 3253525  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 
values      : 0, 7 (min, max)

r2

class       : RasterLayer 
dimensions  : 585, 1386, 810810  (nrow, ncol, ncell)
resolution  : 0.04166599, 0.041666  (x, y)
extent      : 235.207, 292.9561, 25.04224, 49.41686  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +no_defs 
values      : -7.904284, 12.21496  (min, max)

I precise that the resolution of r1 is 100 m and the resolution of r2 is supposed to be 4km. Moreover, the system of coordinates is different as one is in degree and another one in meter. I would like to reproject the rasters in order they keep their own resolution and share the same extent.

I did not find a way to do it. When I upload my data in Arcgis, the rasters are aligned as I would like which is not the case with Qgis and R. The final goal would be to allow raster calculations by stacking the raster for example.

I do not want to reproject the raster from r2 to r1 as I am working with thousands of raster that have the same coordinates than r2.

I can work with Arcgis, Qgis, and R. However, I do not know how to code in Python.