viewshed integration

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

viewshed integration

kabs1969
Hi all,

I am going to calculate cumulative viewshed analysis by adding each viewshed result of several observer locations
with r.mapcalc using Python. Observer locations are read from a file. GenerateViewshed method is executed inside the Iterate
File method (see the methods below). When i execute this it fails create the output with following errors:

ERROR: Sorry, <r> is not a valid flag
ERROR: Sorry, <o> is not a valid flag
ERROR: Sorry, <u> is not a valid flag
ERROR: Sorry, <t> is not a valid flag
ERROR: Sorry, <p> is not a valid flag
ERROR: Sorry, <u> is not a valid flag
ERROR: Sorry, <t> is not a valid flag
ERROR: Sorry, < > is not a valid flag
ERROR: Sorry, <=> is not a valid flag

and in the command console 

Command 'd.rast map=brian@PERMANENT' failed
Details: Unknown display driver <cairo>

The name of the output file i gave is brian which is referred by parameter routput in GenerateViewshed method. Any idea on the errors??

Cheers, Brian

----Python code-------------

def IterateFile(infile):
    
    i=0
    for line in fileinput.input(infile):        
        values = string.split(line,",")
        pid = values[0]
        print pid
        e = values[2]
        print e
        n = values[1]
        print n
        z = values[3]
        print z
        GenerateViewshed(e,n,1.5,25,i)
        i = i + 1

def GenerateViewshed(x,y,oelv,th,i):   
    grass.run_command('r.viewshed', input = rinput, output = 'viewshed', coordinate = [x,y], obs_elev = oelv, tgt_elev = th, memory = 4098, overwrite = True, quiet = True)
    if i==0:
        grass.run_command('r.mapcalc', 'routput = viewshed + 0', overwrite = True, quiet = True)
    if i>=1:
        grass.run_command('r.mapcalc', 'routput = viewshed + routput', overwrite = True, quiet = True)


_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Reply | Threaded
Open this post in threaded view
|

Re: viewshed integration

Helmut Kudrnovsky
>Any idea on the errors??

maybe better to ask in the grass-user ML with an appropriate subject.
best regards
Helmut