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

Sorry I ment r.stream.snap…

···

On Thu, Mar 30, 2017 at 10:23 AM, Johannes Radinger <johannesradinger@gmail.com> wrote:

Dear Ang Sherpa,

r.stream.snap is an add-on. So you first need to install it using e.g g.extension. Have you installed r.stream.order before calling it?

/j

-------- Original message --------
From: Ang Sherpa
Date:30/03/2017 05:34 (GMT+01:00)
To: Helmut Kudrnovsky , GRASS user list
Subject: Re: [GRASS-user] [snap pour point for r.water.outlet]

Thanks for the link Helmut,

However, it throws an error stating:

(Thu Mar 30 09:14:55 2017)
r.stream.snap
‘r.stream.snap’ is not recognized as an internal or external
command,
operable program or batch file.

I am using standalone version Grass gis 7.2.0

Best,
Ang Dawa Sherpa

Regards,
Ang Dawa Sherpa
GIS technician - Irrigation Master Plan
WRPPF - DOI, Nepal Government
Lalitpur
contact: 984 007 3861

On Thu, Mar 30, 2017 at 1:03 AM, Helmut Kudrnovsky <hellik@web.de> wrote:

Ang Sherpa wrote

Hi users,

While using “r.water.outlet” to delineate watershed basin, although the
coordinates of the stream was noted from google earth and fed into
“r.water.outlet” module, it produces plain raster.

Is there any solution to make sure that the coordinates of outlet point
automatically snaps to the nearest line of stream in drainage direction
map?

what about?:

https://grass.osgeo.org/grass72/manuals/addons/r.stream.snap.html

r.stream.snap - Snap point to modelled stream network.
Input can be stream network, point vector map with outlets or outlet
coordinates.


best regards
Helmut

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


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Thanks Johannes,

r.stream.snap does not have attribute table attached and throws an error:“DB connection for vector map XXX not defined.”

With this case, it won’t be of any good use as coordinate of new snaped point cannot be extracted for feeding into “r.water.outlet” - coordinate field.

···

Best,
Ang Dawa Sherpa

On Thu, Mar 30, 2017 at 11:58 AM, Johannes Radinger <johannesradinger@gmail.com> wrote:

Sorry I ment r.stream.snap…

-------- Original message --------
From: Ang Sherpa

Date:30/03/2017 07:32 (GMT+01:00)
To: Johannes Radinger
Cc: Helmut Kudrnovsky , GRASS user list
Subject: Re: [GRASS-user] [snap pour point for r.water.outlet]

Thanks Johannes,

Installed. No I have not installed r.stream.order, is it mandatory or ease the process?

Regards,
Ang Dawa Sherpa
GIS technician - Irrigation Master Plan
WRPPF - DOI, Nepal Government
Lalitpur
contact: 984 007 3861

Best,
Ang Dawa Sherpa

On Thu, Mar 30, 2017 at 10:23 AM, Johannes Radinger <johannesradinger@gmail.com> wrote:

Dear Ang Sherpa,

r.stream.snap is an add-on. So you first need to install it using e.g g.extension. Have you installed r.stream.order before calling it?

/j

-------- Original message --------
From: Ang Sherpa
Date:30/03/2017 05:34 (GMT+01:00)
To: Helmut Kudrnovsky , GRASS user list
Subject: Re: [GRASS-user] [snap pour point for r.water.outlet]

Thanks for the link Helmut,

However, it throws an error stating:

(Thu Mar 30 09:14:55 2017)
r.stream.snap
‘r.stream.snap’ is not recognized as an internal or external
command,
operable program or batch file.

I am using standalone version Grass gis 7.2.0

Regards,
Ang Dawa Sherpa
GIS technician - Irrigation Master Plan
WRPPF - DOI, Nepal Government
Lalitpur
contact: 984 007 3861

On Thu, Mar 30, 2017 at 1:03 AM, Helmut Kudrnovsky <hellik@web.de> wrote:

Ang Sherpa wrote

Hi users,

While using “r.water.outlet” to delineate watershed basin, although the
coordinates of the stream was noted from google earth and fed into
“r.water.outlet” module, it produces plain raster.

Is there any solution to make sure that the coordinates of outlet point
automatically snaps to the nearest line of stream in drainage direction
map?

what about?:

https://grass.osgeo.org/grass72/manuals/addons/r.stream.snap.html

r.stream.snap - Snap point to modelled stream network.
Input can be stream network, point vector map with outlets or outlet
coordinates.


best regards
Helmut

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


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Fixed issue with v.distance instead.

First stream network was converted into vector format. Any coordinate user enter will be converted into vector on the fly and calculate the v.distance between stream network and newly formed point vector. Finally, the point vector will be deleted before the user enter another coordinate.

···

On Thu, Mar 30, 2017 at 12:06 PM, Ang Sherpa <angsherpa232@gmail.com> wrote:

Thanks Johannes,

r.stream.snap does not have attribute table attached and throws an error:“DB connection for vector map XXX not defined.”

With this case, it won’t be of any good use as coordinate of new snaped point cannot be extracted for feeding into “r.water.outlet” - coordinate field.

Best,
Ang Dawa Sherpa

Best,
Ang Dawa Sherpa

Regards,
Ang Dawa Sherpa
GIS technician - Irrigation Master Plan
WRPPF - DOI, Nepal Government
Lalitpur
contact: 984 007 3861

On Thu, Mar 30, 2017 at 11:58 AM, Johannes Radinger <johannesradinger@gmail.com> wrote:

Sorry I ment r.stream.snap…

-------- Original message --------
From: Ang Sherpa

Date:30/03/2017 07:32 (GMT+01:00)
To: Johannes Radinger
Cc: Helmut Kudrnovsky , GRASS user list
Subject: Re: [GRASS-user] [snap pour point for r.water.outlet]

Thanks Johannes,

Installed. No I have not installed r.stream.order, is it mandatory or ease the process?

Best,
Ang Dawa Sherpa

On Thu, Mar 30, 2017 at 10:23 AM, Johannes Radinger <johannesradinger@gmail.com> wrote:

Dear Ang Sherpa,

r.stream.snap is an add-on. So you first need to install it using e.g g.extension. Have you installed r.stream.order before calling it?

/j

-------- Original message --------
From: Ang Sherpa
Date:30/03/2017 05:34 (GMT+01:00)
To: Helmut Kudrnovsky , GRASS user list
Subject: Re: [GRASS-user] [snap pour point for r.water.outlet]

Thanks for the link Helmut,

However, it throws an error stating:

(Thu Mar 30 09:14:55 2017)
r.stream.snap
‘r.stream.snap’ is not recognized as an internal or external
command,
operable program or batch file.

I am using standalone version Grass gis 7.2.0

Regards,
Ang Dawa Sherpa
GIS technician - Irrigation Master Plan
WRPPF - DOI, Nepal Government
Lalitpur
contact: 984 007 3861

On Thu, Mar 30, 2017 at 1:03 AM, Helmut Kudrnovsky <hellik@web.de> wrote:

Ang Sherpa wrote

Hi users,

While using “r.water.outlet” to delineate watershed basin, although the
coordinates of the stream was noted from google earth and fed into
“r.water.outlet” module, it produces plain raster.

Is there any solution to make sure that the coordinates of outlet point
automatically snaps to the nearest line of stream in drainage direction
map?

what about?:

https://grass.osgeo.org/grass72/manuals/addons/r.stream.snap.html

r.stream.snap - Snap point to modelled stream network.
Input can be stream network, point vector map with outlets or outlet
coordinates.


best regards
Helmut

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


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Ang Sherpa wrote

Thanks Johannes,

r.stream.snap does not have attribute table attached and throws an error:
"DB connection for vector map XXX not defined."

With this case, it won't be of any good use as coordinate of new snaped
point cannot be extracted for feeding into "r.water.outlet" - coordinate
field.

that's not an error, just a warning.

there are different ways to get the point coordinates:

e.g.

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

or

v.db.addtable - Creates and connects a new attribute table to a given layer
of an existing vector map.
v.to.db - Populates attribute values from vector features.

v.to.db option=coor: point coordinates, X,Y or X,Y,Z

and some others ....

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

Thanks Helmut,
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’]

···

On Thu, Mar 30, 2017 at 3:45 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

Ang Sherpa wrote

Thanks Johannes,

r.stream.snap does not have attribute table attached and throws an error:
“DB connection for vector map XXX not defined.”

With this case, it won’t be of any good use as coordinate of new snaped
point cannot be extracted for feeding into “r.water.outlet” - coordinate
field.

that’s not an error, just a warning.

there are different ways to get the point coordinates:

e.g.

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

or

v.db.addtable - Creates and connects a new attribute table to a given layer
of an existing vector map.
v.to.db - Populates attribute values from vector features.

v.to.db option=coor: point coordinates, X,Y or X,Y,Z

and some others …


best regards
Helmut

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


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Best,
Ang Dawa Sherpa

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.

Thanks,

···

On Fri, Mar 31, 2017 at 3:34 PM, Helmut Kudrnovsky <hellik@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@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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Best,
Ang Dawa Sherpa