Hi, > On 8 February 2012 11:35, Johannes Radinger <[email protected]> wrote: > > I try to run v.to.rast of a line in a loop > > to get a raster for each attribute of the vector (multiple columns). > > Therefore I created a short python script, which is working > > expept for that I am getting error messages: > > ERROR: option <output>: <raster_attribute> exists. > > > > Here the code: > > > > #!/usr/bin/env python > > > > import sys > > > > import grass.script as grass > > import grass.script.setup as gsetup > > > > def main(): > > > > for i in ['FULL_HYDRO','LENGTH']: > > > > grass.run_command("v.to.rast", > > input = "streams@PERMANENT", > > output = "rast_"+i, > > type = "line", > > use = "attr", > > column = i) > > > > return 0 > > > > if __name__ == "__main__": > > sys.exit(main()) > > Have you tried adding flags = '-o' as an argument to > grass.run_command? That will overwrite the output raster if it already > exists.
I haven't tried yet to use the overwrite option. It'll probably work. It is just that I am wondering why these rasters "exist" although all rasters are entirely removed from the mapset. Can you reproduce this behaviour with that script and the North Carolina dataset? > > Cheers, > Scott > _______________________________________________ > grass-user mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/grass-user -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://www.gmx.net/de/go/freephone/ _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
