Dear all
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:
*>>>*import grass.script as gscript
*>>>*types = ("primary" , "secondary" , "tertiary" , "service" ,
"pedestrian" , "footway" , "residential" , "path")
*>>>*for typ in types:
*>>>> * gscript.run_command ("v.to.rast" , input = "road_clip" , type =
"line" , where ="type"=typ , output = types, use = "attr" ,
attribute_column = "cat").
*I got the following traceback:* File
"/home/alessandro/GRASSDATA/5_citta_def/5_citt_def/.tmp
/alessandro-Lenovo-G50-70/5500.6.py", line 6
gscript.run_command ("v.to.rast" , input = "road_clip" ,
type = "line" , where ="type"=typ , output = types, use =
"attr" , attribute_column = "cat")
^
SyntaxError: invalid syntax
i guess the syntax error is in the way i set the query, but i'm not sure.
Thanks to everybody,
_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user