[GRASS-user] [snap pour point for r.water.outlet]
Ang Sherpa
angsherpa232 at gmail.com
Fri Mar 31 02:56:37 PDT 2017
Thanks,
*Best,*
*Ang Dawa Sherpa*
On Fri, Mar 31, 2017 at 3:34 PM, Helmut Kudrnovsky <hellik at web.de> 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 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.
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170331/6c2f94a4/attachment.html>
More information about the grass-user
mailing list