[GRASS-user] [snap pour point for r.water.outlet]

Helmut Kudrnovsky hellik at web.de
Fri Mar 31 02:49:13 PDT 2017


>Actually when I tried to extract only the x and y with following code it
throws an error "KeyError: 'x'"
>
>s =
>gscript.parse_command(gscript.parse_command('v.report',map='snap_test',option='coor',units='meters')
>print s['x']

as you can see

> v.report map=mysampleoutlet_snapped at user1 option=coor
> cat|x|y|z
> 1|635555|219665|0

the v.report output isn't in a form of a pythonic key:value form, therefore
you have to adapt your script to  e.g. split the output in python and read
in the coordinates.

you can also use e.g.

v.to.db -p --quiet map=mysampleoutlet_snapped at user1 option=coor                 
1|635555|219665|0

than it's maybe easier to split the output in python





-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/snap-pour-point-for-r-water-outlet-tp5314835p5315147.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list