Saturday, 19 December 2015

coordinate system - Projection of raster to sinusoidal projection


I have my definitive raster shown below. This raster has the projection as mentioned here


class       : RasterLayer 
dimensions : 7276, 8330, 60609080 (nrow, ncol, ncell)
resolution : 463.3127, 463.3127 (x, y)
extent : 6508617, 10368012, 751956.5, 4123020 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0

data source :

names :
values : 0, 578 (min, max)

I have another land use land cover raster (each pixel value being categorical) that is in WGS1984 coordinate system i.e. no projection. I want project this raster to the same projection as the definitive raster to do more analysis.


I did so in R as follows


lulc_reproj<-projectRaster(lulc_, res=res(defintive raster),crs=crs(definitive raster), method='ngb')

It did complete with no errors and I could continue with my analysis. However, I viewed the projected lulc raster and the definitive raster in Arc and see that two rasters do not align. For example, below is a snapshot of the water class in the reprojected lulc raster (light blue) which is way off from the water in the definitive raster (which is NoData and displayed in red) enter image description here


The same is the case when viewed in QGIS. Like I mentioned earlier, no errors come up in R and the projection strings match additional to the resolution.



I also tried projecting the lulc raster in ArcMap as I have read that Arc uses different transformation algorithms than gdal, on which rgdal and raster packages are based. However, I get the exact same results i.e. no alignment


So why are the rasters not aligned even if they have the same projections and resolutions? How do I fix it?




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...