I need to do integrated viewshed analysis of a target with several observer locations. I am going to use r.viewshed analysis function in GRASS. With this function, it is possible to perform analysis based on single observer location. My aim is to add output of each single observer location into integrated viewshed output. Each output, i am going to flag with -b where o denotes non-visible while 1 denotes visible. Through a loop of observer locations, output of viewshed of each location can be integrated with r.mapcalc function. After integration, values = 0 in the rater map dentoes non-visible areas and value >= 1 denotes visible areas. Under the loop of observer locations I just used r.mapcalc function with each viewshed adding. After getting the integrated viewshed raster, i need to extract its boundary depicting visible area in vector format. How to do that in GRASS?
Using IterateFile method, i read observer locations and with GenerateViewshed method, i calculate each single viewshed of a particular location. Then with r.mapcalc, i integrated all viewsheds. I want to find if r.mapcalc python code i have used is correct. If it is correct, how to extract the boundary of the visible area in vector format?
for line in fileinput.input(infile):
values = string.split(line,",")
pid = values
e = values
n = values
z = values
i = i + 1
standard_DEM = options['standardDEM']
output = options['outputmap']
grass.run_command('r.viewshed', input=standard_DEM, output='viewshed',coordinate=[x,y], obs_elev=oelv,
grass.mapcalc('output = viewshed + 0')
grass.mapcalc('output = viewshed + output')