[GRASS-dev] r.in.gdal: Ignores `band' parameter

Ivan Shmakov ivan at theory.asu.ru
Wed Dec 26 15:01:14 EST 2007


	It seems that `r.in.gdal' ignores the `band' parameter -- the
	resulting raster is the same whatever band number is specified.

...
   378	/* -------------------------------------------------------------------- */
   379	/*      Simple case.  Import a single band as a raster cell.            */
   380	/* -------------------------------------------------------------------- */
   381	    if( !force_imagery )
   382	    {
   383	        int	nBand = 1;
   384	        
   385	        if( parm.band->answer != NULL )
   386	            nBand = atoi(parm.band->answer);
   387	        
   388	        hBand = GDALGetRasterBand(hDS,1);

	Shouldn't there be s/1/nBand/ instead?

   389	        if( hBand == NULL )
   390	        {
   391	            sprintf( error_msg, _("Selected band (%d) does not exist.\n"), 
   392	                     nBand );
   393	            G_fatal_error( error_msg );
   394	        }
   395	        
   396	        ImportBand( hBand, output, NULL );
   397	
   398	        if (title)
   399	            G_put_cell_title (output, title);
   400	    }
...



More information about the grass-dev mailing list