Sunday 24 March 2019

Raster alignment doesn't produce aligned results


I have two rasters with different extent and resolution, same coordinate reference, from two different surveys - one RGB and one NIR - takes on different times.



nir_in
class : RasterBrick

dimensions : 981, 1232, 1208592, 4 (nrow, ncol, ncell, nlayers)
resolution : 1.04782e-06, 9.801315e-07 (x, y)
extent : -45.40288, -45.40158, -21.56267, -21.56171 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0


rgb_in
class : RasterBrick
dimensions : 978, 1228, 1200984, 4 (nrow, ncol, ncell, nlayers)
resolution : 1.05155e-06, 9.835644e-07 (x, y)
extent : -45.40288, -45.40159, -21.56272, -21.56176 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0




I have aligned both rasters using align_rgb = resample(rgb_in, nir_in, "bilinear") and it returned



align_rgb
class : RasterBrick
dimensions : 981, 1232, 1208592, 4 (nrow, ncol, ncell, nlayers)
resolution : 1.04782e-06, 9.801315e-07 (x, y)
extent : -45.40288, -45.40158, -21.56267, -21.56171 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0




which seem right, but when I try to plot view the results in QGIS the rasters remains unaligned. I have noticed that the differences are from 6th decimal place onwards.


Am I doing something wrong?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...