[STATSGRASS] R - problem with mapsets

Roger Bivand Roger.Bivand at nhh.no
Thu Jul 29 05:11:55 EDT 2004


Marta:

Thanks, this is helpful. I'll look at rast.get(), the underlying C 
function rastget, and the GRASS function it calls (G_find_cell()) - 
rastget doesn't try to parse the @, and if G_find_cell() doesn't, then the 
behaviour you see is reasonable. Markus and I looked at this last year and 
I think we thought we had a solution, but it obviously isn't good enough.

Roger


On Thu, 29 Jul 2004 marta.benito at uam.es wrote:

> Hello, thanks Roger, following the same example:
> 
> >grass5 ms1
> >R
> >(help(package=GRASS))
> Package: GRASS
> Version: 0.2-13
> Date: 2003/09/25
> >print(G) 
> $LOCATION
> [1] "rtest"
> $MAPSET
> [1] "ms1"
> $proj
> [1] "UTM, zone: 30"
> $n
> [1] 1
> $s
> [1] 0
> $w
> [1] 0
> $e
> [1] 1
> $nsres
> [1] 1
> $ewres
> [1] 1
> $Nrow
> [1] 1
> $Ncol
> [1] 1
> $Ncells
> [1] 1
> $xlims
> [1] 0 1
> $ylims
> [1] 0 1
> $xseq
> [1] 0.5
> $yseq
> [1] 0.5
> $ryseq
> [1] 0.5
> attr(,"class")
> [1] "grassmeta"
> get.mapsets()
> [1] "ms1"       "PERMANENT"
> r <- rast.get(G,"r at ms2")
> print(r)
> $r
> [1] 123
> > system("g.mapsets mapset=ms2")
> > refresh.mapsets()
> [1] "ms1" "ms2"
> > get.mapsets()
> [1] "ms1" "ms2"
> > r <- rast.get(G,"r at ms2")
> > print(r)
> $r
> [1] 123
> 
> 
> 
> Marta
> 
> 
> > On Wed, 28 Jul 2004 marta.benito at uam.es wrote:
> > 
> > > Hello, 
> > > I try to work in R (using GRASS library) with two different maps with the same
> > > name that are located in two different mapsets:
> > > mapset1: map r
> > > mapset2: map r
> > > 
> > > and allways I get the same map 
> > > 
> > > > grass5 ms1
> > > > g.region w=0 s=0 e=1 n=1
> > > > r.mapcalc r=123
> > > > exit
> > > 
> > > > grass5 ms2
> > > > g.region w=0 s=0 e=1 n=1
> > > > r.mapcalc r=456
> > > > R
> > > > library(GRASS)
> > > > G <-gmeta()
> > > > r <- rast.get(G,"r at ms1")
> > > > r
> > > $r
> > > [1] 456
> > 
> > I'll have a look, could you tell me which version of the GRASS interface 
> > you are using (help(package=GRASS)), and what print(G) says? What does 
> > get.mapsets() say?
> > 
> > Roger
> > 
> > > 
> > > 
> > >  
> > > Thanks
> > > 
> > > Marta
> > > 
> > > --------------------------------------------------------------------------
> > > Mensaje enviado mediante una herramienta Webmail integrada en *El Rincon*:
> > > ------------->>>>>>>>     https://rincon.uam.es     <<<<<<<<--------------
> > > 
> > > 
> > > _______________________________________________
> > > statsgrass mailing list
> > > statsgrass at grass.itc.it
> > > http://grass.itc.it/mailman/listinfo/statsgrass
> > > 
> > 
> > -- 
> > Roger Bivand
> > Economic Geography Section, Department of Economics, Norwegian School of
> > Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
> > Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
> > e-mail: Roger.Bivand at nhh.no
> > 
> > 
> > _______________________________________________
> > statsgrass mailing list
> > statsgrass at grass.itc.it
> > http://grass.itc.it/mailman/listinfo/statsgrass
> > 
> > 
> 
> 
> --------------------------------------------------------------------------
> Mensaje enviado mediante una herramienta Webmail integrada en *El Rincon*:
> ------------->>>>>>>>     https://rincon.uam.es     <<<<<<<<--------------
> 
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no





More information about the grass-stats mailing list