Thanks Tom. I did set the MODIS projection parameters to match the PRISM data so I'm not sure why there is the difference….



On Tuesday, January 14, 2014 5:32:48 AM, Thomas Adams <tea3rd@gmail.com> wrote:
 
Julie,

I suspect it's a combination of a mismatch between either/or the map projection and geodetic datum for the MODIS NDVI and PRISM data. The ModisDownload has the option, proj_type:

Output projection short name. Valid values are AEA (Albers EqualArea), ER (Equirectangular), GEO (Geographic), IGH (Interrupted Goode Homolosine), HAM (Hammer), ISIN (Integerized Sinusoidal), LA (Lambert Azimuthal Equal Area), LCC (Lambert Conformal Conic), MERCAT (Mercator), MOL (Molleweide), PS (Polar Stereographic), SIN (Sinusoidal), TM (Transverse Mercator), and UTM (Universal Transverse Mercator). 

PRISM is North American Datum of 1983, latitude-longitude, 0.04166667 deg resolution. The data must be projected to the same map projection; then you can do your resampling

Regards,
Tom



On Tue, Jan 14, 2014 at 7:39 AM, Julie Lee-Yaw <julleeyaw@yahoo.ca> wrote:

Hi 
>
>Using a combination of the scripts provided here (by Babak N.): http://r-gis.net/?q=ModisDownload and the MODIS reproject tool, I've finally managed to download NDVI data for North America and project it to the same geographic coordinate system as PRISM precip. data (e.g. http://www.prism.oregonstate.edu) for the same time period. 
>
>I now want to stack these two rasters. My NDVI layer has a greater extent than the PRISM layer so I crop the former by the latter using:
>
>croppedNDVI<-crop(NDVI,prism)
>
>
>But when I look at the resulting raster, I see that the extent still doesn't line up. I think this is an issue with cells of the two rasters being "off" centre from each other. I can use the following to get them to align:
>
>adjustNDVI<-resample(croppedNDVI,prism)
>
>
>Now I can stack the "adjustNDVI" and "prism" layers as the extents match. But I am wondering whether this is valid? Why were the initial rasters misaligned in the first place given that I specified the same resolution and geographic coordinate system/datum when I processed the MODIS file? I'm grateful for any clarification!
>        [[alternative HTML version deleted]]
>
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo@r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
	[[alternative HTML version deleted]]

