[GRASSLIST:847] Re: 2: UNSOLVABLE problem in GRASS!!?

Massimiliano Cannata massimiliano.cannata at ist.supsi.ch
Tue Jul 29 03:11:31 EDT 2003


your raster bound11r at Ramin is 1 inside and 0 outside.
so maybe try with:

    -- if(x,a) NULL if x is NULL; a if x is non-zero; 0 otherwise

so should be:

    GRASS:~ > r.mapcalc
    new=if(bound11r,slope11r)

Ciao.


Ramin Safa wrote:

> Hi Massimilliano
> Hi Paul
>
> I did these:    1.*Massimiliano advice:
> r.mask
> MASK:  Program for managing current GIS mask
>
> current mask:          <bound11r at Ramin> in mapset <Ramin>
> masking category(ies): 1
> inside=1,outsid=0    and then:
> GRASS:~ > r.mapcalc
> new="if(isnull(bound11r),slope11r%%,bound11r)"
> parse error
> Parse error
> I've checked any thing,but i dont know why eror?
>
>   2.*Paul advice:
>
> GRASS:~ > g.copy rast=bound11r,MASK
> COPY [bound11r at Ramin] to [MASK]
>  raster
>  header
>  category
>  color
>  history
>  misc
>  fcell    MISSING
>  g3dcell  MISSING
> GRASS:~ > r.resample input=slope11r%% output=slopefin
> percent complete:  100%
> Creating support files for slopefin
> creating new cats file...
> GRASS:~ > g.remove MASK
> REMOVE [MASK]
>  raster
>  header
>  category
>  color
>  history
>  misc
>  fcell    MISSING
>  g3dcell  MISSING
> GRASS:~ > d.erase
> GRASS:~ > d.rast slopefin
>  100%
> The Resault is nothing,blank??!
>
> PLEASE if the ways are not correct ,tell me.
> Regards
> Ramin
>
> --- Paul Kelly <paul-grass at stjohnspoint.co.uk> wrote:
> >
> >
> > On Mon, 28 Jul 2003, Massimiliano Cannata wrote:
> >
> > > If it is, once you have your raster boundary map
> > (suppose with
> > > value=1 inside and value=0 outside) and your raster
> > slope map you
> > > should run r.mapcalc so to have NULL outside and slope
> > inside.
> > > (something like this but check the rigth formalism:
> > > if
> > > boudary = 0 final_map=NULL
> > > else if
> > > boundary=1 final_map=slope_map)
> >
> > Using a MASK is the more conventional way:
> >
> > g.copy rast=boundary,MASK
> > r.resample input=slope_map output=final_map
> > g.remove rast=MASK
> >
> > Any cell that is zero or NULL in the MASK will be masked
> > out during any
> > subsequent raster operations while the MASK is in force.
> >
> > I'm not sure if r.mapcalc totally copies all the parts of
> > a raster; maybe
> > it does now. r.resample is probably the more 'correct'
> > command to use but
> > as usual there are several ways of doing the same thing.
> >
> > You can create masks using the r.mask command but I've
> > always found it
> > easier to create it some other way and then copy it to
> > the raster map
> > 'MASK' using g.copy and g.remove as shown above.
> >
> MASK:  Program for managing current GIS mask
>
> current mask:          <bound11r at Ramin> in mapset <Ramin>
> masking category(ies): 1
>
> =====
>
> Ramin Safamanesh
> Department of  Environment Science , UPM
> Email :  rsafamanesh at hotmail.com Tel  :  0060122399448
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com

--
-------------
Ing.  Massimiliano Cannata
Istituto di Scienze della Terra - SUPSI
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 91 /935 12 25 - Fax +41 91 /935 12 09
eMail: massimiliano.cannata at ist.supsi.ch
Internet: http://www.ist.supsi.ch




More information about the grass-user mailing list