[GRASSLIST:4749] Re: best command for operation?

Eric G. Miller egm2 at jps.net
Tue Oct 15 21:24:34 EDT 2002


On Tue, Oct 15, 2002 at 11:07:59AM -0700, Jeff D. Hamann wrote:
> I've got a few (about five say) raster files that I need to combine into a
> fuels model layer, such that the cells will contain categories (0-14,
> etc)...
> 
> I have a raster file for slope, aspect, elev, veg type, etc....
> 
> I need to perform calcs like:
> 
>     if( elev > 3000 && slope > 40 pct && aspect >= 90 && aspect < 270 )
>     {
>         fuel_model = high alt fuel model
>     }
> 
>     if( elev <= 3000 && slope > 40 pct && aspect >= 90 && aspect < 270 )
>     {
>         fuel_model = low alt fuel model
>     }
> 
> I'm using GRASSpre4 on cygwin, win2k, and can write C code just fine. Should
> be using r.combine, r.mapcalc, or write some C code (using a lib that I can
> read/write GRASS files independently of GRASS) to perform this task.

I'd try to solve it in the following order:

1. r.mapcalc
2. shell scripting
3. C programming

>From what you've posted, it looks like r.mapcalc can handle it.

-- 
static const char signature[] = 
	"Copyright (c) 2002 Eric G. Miller <egm2 at jps.net>";



More information about the grass-user mailing list