Can anyone help me to use gdal(gdalwarp specifically) for reprojection? I am using it to reproject MODIS data :
I originally have an hdf file - MCD43A4.A2005001.h08v05.005.2007351192333.hdf which has SDS of size 2400 x 2400 at 500m resolution.
I then reprojected it using :
gdalwarp -t_srs '+proj=latlong' -srcnodata 32767 -dstnodata 32767 HDF4_EOS:EOS_GRID:"MCD43A4.A2005001.h08v05.005.2007351192333.hdf":MOD_Grid_BRDF:Nadir_Reflectance_Band1 band1.tif.
This works fine but as I convert from sinusoidal to lat/long, the image size is now 3177 x 1194. I was wondering if this remains at 500m resolution?
To set the resolution manually I tried using the -tr option of gdalwarp:
gdalwarp -t_srs '+proj=latlong' -tr 500 500 -srcnodata 32767 -dstnodata 32767 HDF4_EOS:EOS_GRID:"MCD43A4.A2005001.h08v05.005.2007351192333.hdf":MOD_Grid_BRDF:Nadir_Reflectance_Band1 band1.tif.
This gives an error : Attempt to create 0 x 0 dataset is illegal, sizes must be greater than 0.
Can anyone please help me out figuring this - whether I need to manually set the resolution(and how to fix the error) or can I use the 3177 x 1194 image?
gdalinfo band1.tif
will tell you the pixel size of the reprojected file.