Send grass-windows mailing list submissions to
        grass-windows@lists.osgeo.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/grass-windows
or, via email, send a message with subject or body 'help' to
        grass-windows-requ...@lists.osgeo.org

You can reach the person managing the list at
        grass-windows-ow...@lists.osgeo.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of grass-windows digest..."


Today's Topics:

   1. viewshed integration (Brian Sanjeewa Rupasinghe)


----------------------------------------------------------------------

Message: 1
Date: Sun, 6 Jan 2013 23:56:35 +0530
From: Brian Sanjeewa Rupasinghe <jink...@gmail.com>
To: grass-windows@lists.osgeo.org
Subject: [GRASS-windows] viewshed integration
Message-ID:
        <CAEMA-4g1CDJJXFB7SD2PgDHyooUs=askuhwv3qlu1kmtfe-...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.osgeo.org/pipermail/grass-windows/attachments/20130106/efc73359/attachment-0001.html>

------------------------------

_______________________________________________
grass-windows mailing list
grass-windows@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-windows


End of grass-windows Digest, Vol 69, Issue 4
********************************************

Reply via email to