[R-sig-Geo] [GRASS-stats] Re: GRASS commands (fwd)

alexandre villers alexandre.villers at cebc.cnrs.fr
Tue Sep 1 22:33:23 CEST 2009


Good evening,

Thank you for the message. I had already tried this but then got the error message:

 execGRASS("v.mkgrid", flags="overwrite", parameters=list(map="grilleTest", grid=paste(as.integer(100), as.integer(100), sep=","), box=paste(as.integer(5000),",",as.integer(5000),sep=""), position="region")) #créer une grille de box1 mètres sur box2 mètres sur la région   !!! PB WITH the double argument required for box and grid).
Erreur dans doGRASS(cmd, flags = flags, parameters = parameters) :
  Parameter <grid> does not have integer value

Does this make sense to you ? v.mkgrid is asking for an integer but the paste() has turned integer into character... and list of the 2 integers is also rejected because of the "multiple = NO" argument...

I'm afraid I can't go further...

Best regards

Alex

-----Original Message-----
From: Markus Neteler <neteler at cealp.it>
To: Roger.Bivand at nhh.no
Date: Tue, 01 Sep 2009 22:22:49 +0200
Subject: Re: [GRASS-stats] Re: [R-sig-Geo] GRASS commands (fwd)

2009/9/1 Roger Bivand <Roger.Bivand at nhh.no>:
 > Is this a bug in the interface description of v.mkgrid? It needs
 > grid=rows,columns but sets multiple=NO, so wxpython fails (needing two
 > values but getting one, but only providing an integer entry box).

It needs two values which are treated as one string, so it is correct.
(E.g. r.series accepts multiple input maps which are separate tokens which
required multiple=YES).

...
 >> grid=c(as.integer(100),as.integer(100)), box=c(5000, 5000),
 >> position="region"))
 >> returns
 >> Erreur dans doGRASS(cmd, flags = flags, parameters = parameters) :
 >>   Parameter <grid> has multiple values
 >>
 >> How do I specify the two values when multiple is not allowed. I did not
 >> get it....

You used
 > c(as.integer(100),as.integer(100))
[1] 100 100

 > c(5000, 5000)
[1] 5000 5000

which leads to space separated values. But we want

 > paste(as.integer(100), as.integer(100), sep=",")
[1] "100,100"

 > Consider the statsgrass list for use of the interface between R and 
GRASS,
 > in this case there is an interaction between a possible bug in 
v.mkgrid and
 > the parsing of its parameters.
 >
 > Since v.mkgrid does declare that grid does *not* take multiple 
values, the
 > (current) logic of doGRASS() is defeated, as it checks that the multiple
 > attribute if the GRASS parameter is not "NO", see
 >
 > 
http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.mkgrid/main.c#L74
 >
 > The discrepancy between the code and the documentation is obvious.

There is no real discrepancy...
Hope above comments clarify it.

If not, we would need to see some debug output of doGRASS()...

Markus

-- 
Markus Neteler
Foundation Edmund Mach (FEM) - Research and Innovation Centre
Environment and Natural Resources Area
GIS and Remote Sensing Unit, Trento, Italy
Web:  http://gis.fem-environment.eu/



__________ Information from ESET Mail Security, version of virus signature database 4387 (20090901) __________

The message was checked by ESET Mail Security.
http://www.eset.com




Alexandre Villers
PhD. Student
Team Biodiversity
CEBC CNRS
79360 Beauvoir sur Niort


__________ Information from ESET Mail Security, version of virus signature database 4387 (20090901) __________

The message was checked by ESET Mail Security.
http://www.eset.com



More information about the R-sig-Geo mailing list