<div dir="ltr"><div><div>Hi, <br>I'm trying to merge this 3 tif files having different pixel resolution in one single file. <br> <br>wget <a href="https://dl.dropboxusercontent.com/u/29337496/nc/tpi_max_km10.tif">https://dl.dropboxusercontent.com/u/29337496/nc/tpi_max_km10.tif</a><br>wget <a href="https://dl.dropboxusercontent.com/u/29337496/nc/tpi_max_km50.tif">https://dl.dropboxusercontent.com/u/29337496/nc/tpi_max_km50.tif</a><br>wget <a href="https://dl.dropboxusercontent.com/u/29337496/nc/tpi_max_km100.tif">https://dl.dropboxusercontent.com/u/29337496/nc/tpi_max_km100.tif</a><br><br></div>According to my understanding the only raster format that support different pixel resolution are HDF & NetCDF. <br><br></div>I opt for the NetCDF format and I wrote the following script that, change the format from tif to nc, change some internal parameters using NCO and in the end merge (grupping - in NCO terminology) the *.nc together. <br><div><div><br>longname=Topographic_position_index<br>VAR=tpi_max_km<br>for km in 10 50 100 ; do<br> if [ $km -eq 10 ] ; then b=1 ; fi <br> if [ $km -eq 50 ] ; then b=2 ; fi <br> if [ $km -eq 100 ] ; then b=3 ; fi <br><br> gdal_translate -of netCDF -co ZLEVEL=9 -co COMPRESS=DEFLATE -co FORMAT=NC4C $VAR$km.tif $VAR$<a href="http://km.nc">km.nc</a> <br><br>### Change some parameters <br> ncatted -O -a long_name,Band1,o,c,${longname} $VAR$<a href="http://km.nc">km.nc</a> -h <br> ncatted -O -a long_name,lon,o,c,Longitude $VAR$<a href="http://km.nc">km.nc</a> -h<br> ncatted -O -a long_name,lat,o,c,Latitude $VAR$<a href="http://km.nc">km.nc</a> -h<br> ncatted -O -a _FillValue,Band1,o,i,-9999 $VAR$<a href="http://km.nc">km.nc</a> -h<br> ncrename -v Band1,${VAR}${km} $VAR$<a href="http://km.nc">km.nc</a> -h<br><br>done<br><br></div><div># create multi-dimension nc <br></div><div>ncecat --gag <a href="http://tpi_max_km10.nc">tpi_max_km10.nc</a> <a href="http://tpi_max_km50.nc">tpi_max_km50.nc</a> <a href="http://tpi_max_km100.nc">tpi_max_km100.nc</a> <a href="http://out.nc">out.nc</a> <br><br></div><div>The problem comes when I want read the output using gdal. <br></div><div><br>gdalinfo <a href="http://out.nc">out.nc</a> <br>Warning 1: <a href="http://out.nc">out.nc</a> is a netCDF file, but not in GMT configuration.<br>gdalinfo failed - unable to open '<a href="http://out.nc">out.nc</a>'.<br><br></div><div>Is gdal 1.10.0 able to read multidimensional NetCDF ? <br></div><div>Can I do "ncecat --gag" (grouping) operation using gdal?<br><br></div><div>Any ideas?<br></div><div>Thanks <br></div><div><br></div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Giuseppe Amatulli, Ph.D.
<br><br>Department of Ecology and Evolutionary Biology, Yale University.<br></div>Jetz Lab, OML Room 405 <span> </span><span> </span><br><div><div> P.O. Box 208106<br>165 PROSPECT ST<br>New Haven, CT 06520-8106<br><div>
Teaching: <a href="http://spatial-ecology.net" target="_blank">spatial-ecology.net</a>
</div>
Work: <a href="http://sbsc.yale.edu/giuseppe-amatulli" target="_blank">http://sbsc.yale.edu/giuseppe-amatulli</a> <br><a href="http://www.spatial-ecology.net" target="_blank"></a></div></div></div></div></div></div></div></div>
</div></div></div>