Thanks,

*Best,*
*Ang Dawa Sherpa*



On Fri, Mar 31, 2017 at 3:34 PM, Helmut Kudrnovsky <[email protected]> wrote:

> >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@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.
> _______________________________________________
> grass-user mailing list
> [email protected]
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to