[GRASS-user] syntax for grass.run_command("v.rast.stat")

Helmut Kudrnovsky hellik at web.de
Sat Oct 24 01:53:39 PDT 2015


Grazia Zulian wrote
> Hi Anna
> It should add a new field to a vector with a statistic derived from a
> raster.
> It works manually. Not in the pytho scrip. Is the syntax correct? 
> 
> Inviato da iPhone
> 
>> Il giorno 23/ott/2015, alle ore 19:07, Anna Petrášová <

> kratochanna@

> > ha scritto:
>> 
>> 
>> 
>>> On Fri, Oct 23, 2015 at 10:31 AM, Gra <

> graziaz@

> > wrote:
>>> I'm using 
>>> 
>>> v.rast.stat in a python code
>> it's v.rast.stats and use map instead of vector, please see manual page:
>> https://grass.osgeo.org/grass70/manuals/v.rast.stats.html 
>>> 
>>> 
>>> grass.run_command("v.rast.stat", vector = vect+"_"+suffix +'_300',
>>> raster= "r_main_roads_dist" + suffix, colprefix="AVG_mainroads",
>>> method="average")
>>> 
>>> apparently it doens't like my syntax
>>> 
>>> ideas?
>>> 

as Anna mentioned in her reply:

the command is "v.rast.stats" and not as in your python code "v.rast.stat"

the second issue (also mentioned by Anna):

v.rast.stats vector=elev_wakes3 at user1 raster=elevation at PERMANENT
colprefix=rast_ave2 method=average

ERROR: v.rast.stats: Sorry, <vector> is not a valid
parameter
ERROR: Required parameter <map> not set:
        (Name of vector map)



-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/syntax-for-grass-run-command-v-rast-stat-tp5232220p5232312.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list