[GRASS-dev] grass, python, Pygrass
lucadeluge at gmail.com
Wed Jun 26 00:28:49 PDT 2013
On 26 June 2013 06:40, Ivan Marchesini <ivan.marchesini at gmail.com> wrote:
> Dear grass-developers
> I'm working with Python, GRASS and Pygrass and I have some small
> problems probably due to my poor knowledge of Python.
> I would ask your help.
> I have this small code:
this is not your code right?
> grass.run_command("v.to.rast", input=ocs, type="line", output="tmp_ocs", use="val", overwrite=True)
> grass.mapcalc("$outmap = $a", a = dtm, outmap="demcut", overwrite = true)
> grass.run_command("g.remove", rast="visitati")
> np_ocs = raster.RasterNumpy("tmp_ocs")
> for i in range(1,new.shape-1):
> for j in range(1,new.shape-1):
> if np_ocs[i,j] == 1:
> visited[i,j] = 1
> visited[i,j] = 3
> When I run it I obtain a lot of:
> WARNING: rast=visitati,visitati: files could be the same, no rename
> I cannot understand where the warnings arise... and why..
> can you help me??
probably your run more than one your script?
probably you have to add visited.overwrite = True before close your map
please let us know
> many thanks
More information about the grass-dev