<div dir="ltr"><div dir="ltr"><div dir="ltr">Dear all<div>i have a vector (downloaded from OpenStreetmap) with all the streets in my study area. Streets are divided in categories (there is a specific string column in the db). now i want to convert to raster each category separately. I now how to do that separately, but i was not able to automate that in a python script. here it is what i wrote:</div><div><div><b>>>></b>import grass.script as gscript</div><div><b>>>></b>types = ("primary" , "secondary" , "tertiary" , "service" , "pedestrian" , "footway" , "residential" , "path")</div><div><b>>>></b>for typ in types:</div><div><b>>>>> </b>   gscript.run_command ("v.to.rast" , input = "road_clip" , type = "line" , where ="type"=typ , output = types, use = "attr" , attribute_column = "cat").</div></div><div><b>I got the following traceback:</b>   File</div><div>"/home/alessandro/GRASSDATA/5_citta_def/5_citt_def/.tmp</div><div>/alessandro-Lenovo-G50-70/<a href="http://5500.6.py">5500.6.py</a>", line 6</div><div>    gscript.run_command ("v.to.rast" , input = "road_clip" ,</div><div>type = "line" , where ="type"=typ , output = types, use =</div><div>"attr" , attribute_column = "cat")</div><div>                              ^</div><div>SyntaxError: invalid syntax</div><div><br></div><div>i guess the syntax error is in the way i set the query, but i'm not sure. Thanks to everybody,</div></div></div></div>