Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

2015-02-09 Thread Jens Hegg
Ok,  I figured out how to make it work for the vector file. I was including 
both the flow direction and the stream network along with the vector file. It 
turns out that only the direction and vector outlets files are needed and then 
it runs perfectly. The manual examples really should be updated to include a 
vector points example.

I do still have one problem that someone might be able to help with. Many of 
the points I use for outlets are just downstream of one another so it creates 
watersheds that are just small slivers between points. Is it possible for it to 
create overlapping watersheds as you move down the stream, or do I need to go 
back and do this manually?

Jens



On Feb 9, 2015, at 6:08 PM, grass-user-requ...@lists.osgeo.org wrote:

> Send grass-user mailing list submissions to
>   grass-user@lists.osgeo.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://lists.osgeo.org/mailman/listinfo/grass-user
> or, via email, send a message with subject or body 'help' to
>   grass-user-requ...@lists.osgeo.org
> 
> You can reach the person managing the list at
>   grass-user-ow...@lists.osgeo.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of grass-user digest..."
> 
> 
> Today's Topics:
> 
>   1. Import/Export of ESRI Arc ascii grids (Thomas Adams)
>   2. GRASS GIS 7.0.0 RC2 released (Markus Neteler)
>   3. Re: Import/Export of ESRI Arc ascii grids (Markus Neteler)
>   4. Re: Import/Export of ESRI Arc ascii grids
>  (C?sar Augusto Ram?rez Franco)
>   5. Re: v.generalize: does it take forever? (F?bio Dias)
>   6. r.stream.basins vector outlets help (Jens Hegg)
> 
> 
> --
> 
> Message: 1
> Date: Mon, 9 Feb 2015 13:12:45 -0700
> From: Thomas Adams 
> To: "grass-user@lists.osgeo.org" 
> Subject: [GRASS-user] Import/Export of ESRI Arc ascii grids
> Message-ID:
>   
> Content-Type: text/plain; charset="utf-8"
> 
> All,
> 
> I'm probably missing the obvious, but has support for import/export of ESRI
> Arc ascii grids been dropped in GRASS 7.x? I can not find r.in.arc and
> r.out.arc in either the documentation or in GRASS itself. If it has been
> dropped, why? I know I can use GRASS 6.4.x?
> 
> Tom
> -- next part --
> An HTML attachment was scrubbed...
> URL: 
> 
> 
> --
> 
> Message: 2
> Date: Mon, 9 Feb 2015 21:18:21 +0100
> From: Markus Neteler 
> To: GRASS developers list ,GRASS user list
>   
> Cc: OSGeo-discuss ,  GRASS-announce list
>   
> Subject: [GRASS-user] GRASS GIS 7.0.0 RC2 released
> Message-ID:
>   
> Content-Type: text/plain; charset=UTF-8
> 
> We are pleased to announce the second release candidate of the
> upcoming stable GRASS GIS 7.0.0 version.
> Between 7.0.0RC1 and the current 7.0.0RC2 about 100 updates have been applied.
> 
> 
> MOST IMPORTANT CHANGES in RC2:
> 
> * Updated Welcome and splash screens
> * 3D raster: terminology cleanup (raster3D -> 3D raster) in commands and 
> manual
> * g.proj: generate PROJ_EPSG file (contains EPSG code) when location is given
> * r.cost, r.walk: change percent_memory to memory (in MB)
> * v.extract: index added
> * v.in.ogr: do not use old projection for area calculations in new projection
> * v.generalize: self-intersection fix
> * v.patch, v.reclass, v.overlay, v.vect.stats: accommodate SQLite
> * vector lib: numerical stability fixes for centroid calculation
> * vector lib: more robust topology engine
> * some simple mononchrome color tables added
> * wxGUI/nviz: 3D rendering fixes
> * several translations updated
> 
> Related updates in QGIS:
> * Further updates in QGIS Processing - GRASS GIS 7 interface submitted to QGIS
> 
> Related updates in OSGeo-Live:
> * GRASS GIS 7.0.0 RC2 planned to be shipped with the new OSGeo-Live 8.5
> 
> See also our detailed announcement:
> http://trac.osgeo.org/grass/wiki/Release/7.0.0RC-News
> http://trac.osgeo.org/grass/wiki/Grass7/NewFeatures
> 
> DOWNLOAD
> 
> Binaries:
> http://grass.osgeo.org/download/software/#g70rcx
> 
> Source code:
> http://grass.osgeo.org/grass70/source/grass-7.0.0RC2.tar.gz
> http://grass.osgeo.org/grass70/source/grass-7.0.0RC2.md5sum
> 
> Changelog:
> http://grass.osgeo.org/grass70/source/ChangeLog_7.0.0RC2.gz
> 
> Please test on "any" platform which is supported (GNU/Linux,
> MS-Windows, Mac OSX, *BSD, ...).
> 
> The GRASS Development Team
> 
> 
> --
> 
> Message: 3
> Date: Mon, 9 Feb 2015 21:26:01 +0100
> From: Markus Neteler 
> To: Thomas Adams 
> Cc: "grass-user@lists.osgeo.org" 
> Subject: Re: [GRASS-user] Import/Export of ESRI Arc ascii grids
> Message-ID:
>   
> Content-Type: text/plain; charset=UTF-8
> 
> On Mon, Feb 9, 2015 at 9:12 PM, Thomas Adams  wrote:
>> All,
>> 
>> I'm probably missing the obvious, but h

Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

2015-02-09 Thread Blumentrath, Stefan
Hei Jens,

If you want to have watersheds which overlap, you have to have them in 
different maps as neither raster nor vector data with topology (as in GRASS 
GIS) allow for overlapping areas.
That again means you would have to run r.stream.basins for your vector points 
individually, e.g. in a loop like this:

points=$(v.db.select -c map=mypoints column=cat)
for p in $points
do
v.extract ...
r.stream.basisns ... 
done

Cheers
Stefan

-Original Message-
From: grass-user-boun...@lists.osgeo.org 
[mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of Jens Hegg
Sent: 10. februar 2015 05:32
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

Ok,  I figured out how to make it work for the vector file. I was including 
both the flow direction and the stream network along with the vector file. It 
turns out that only the direction and vector outlets files are needed and then 
it runs perfectly. The manual examples really should be updated to include a 
vector points example.

I do still have one problem that someone might be able to help with. Many of 
the points I use for outlets are just downstream of one another so it creates 
watersheds that are just small slivers between points. Is it possible for it to 
create overlapping watersheds as you move down the stream, or do I need to go 
back and do this manually?

Jens



On Feb 9, 2015, at 6:08 PM, grass-user-requ...@lists.osgeo.org wrote:

> Send grass-user mailing list submissions to
>   grass-user@lists.osgeo.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://lists.osgeo.org/mailman/listinfo/grass-user
> or, via email, send a message with subject or body 'help' to
>   grass-user-requ...@lists.osgeo.org
> 
> You can reach the person managing the list at
>   grass-user-ow...@lists.osgeo.org
> 
> When replying, please edit your Subject line so it is more specific 
> than "Re: Contents of grass-user digest..."
> 
> 
> Today's Topics:
> 
>   1. Import/Export of ESRI Arc ascii grids (Thomas Adams)
>   2. GRASS GIS 7.0.0 RC2 released (Markus Neteler)
>   3. Re: Import/Export of ESRI Arc ascii grids (Markus Neteler)
>   4. Re: Import/Export of ESRI Arc ascii grids
>  (C?sar Augusto Ram?rez Franco)
>   5. Re: v.generalize: does it take forever? (F?bio Dias)
>   6. r.stream.basins vector outlets help (Jens Hegg)
> 
> 
> --
> 
> Message: 1
> Date: Mon, 9 Feb 2015 13:12:45 -0700
> From: Thomas Adams 
> To: "grass-user@lists.osgeo.org" 
> Subject: [GRASS-user] Import/Export of ESRI Arc ascii grids
> Message-ID:
>   
> Content-Type: text/plain; charset="utf-8"
> 
> All,
> 
> I'm probably missing the obvious, but has support for import/export of 
> ESRI Arc ascii grids been dropped in GRASS 7.x? I can not find 
> r.in.arc and r.out.arc in either the documentation or in GRASS itself. 
> If it has been dropped, why? I know I can use GRASS 6.4.x?
> 
> Tom
> -- next part -- An HTML attachment was 
> scrubbed...
> URL: 
> <http://lists.osgeo.org/pipermail/grass-user/attachments/20150209/38db
> cb14/attachment-0001.html>
> 
> --
> 
> Message: 2
> Date: Mon, 9 Feb 2015 21:18:21 +0100
> From: Markus Neteler 
> To: GRASS developers list ,GRASS user list
>   
> Cc: OSGeo-discuss ,  GRASS-announce list
>   
> Subject: [GRASS-user] GRASS GIS 7.0.0 RC2 released
> Message-ID:
>   
> Content-Type: text/plain; charset=UTF-8
> 
> We are pleased to announce the second release candidate of the 
> upcoming stable GRASS GIS 7.0.0 version.
> Between 7.0.0RC1 and the current 7.0.0RC2 about 100 updates have been applied.
> 
> 
> MOST IMPORTANT CHANGES in RC2:
> 
> * Updated Welcome and splash screens
> * 3D raster: terminology cleanup (raster3D -> 3D raster) in commands 
> and manual
> * g.proj: generate PROJ_EPSG file (contains EPSG code) when location 
> is given
> * r.cost, r.walk: change percent_memory to memory (in MB)
> * v.extract: index added
> * v.in.ogr: do not use old projection for area calculations in new 
> projection
> * v.generalize: self-intersection fix
> * v.patch, v.reclass, v.overlay, v.vect.stats: accommodate SQLite
> * vector lib: numerical stability fixes for centroid calculation
> * vector lib: more robust topology engine
> * some simple mononchrome color tables added
> * wxGUI/nviz: 3D rendering fixes
> * several translations updated
> 
> Related updates in QGIS:
> * Further updates in QGIS Processing - GRASS GIS 7 interface submitted 
> to QGIS
> 
> Related update

Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

2015-02-10 Thread Jens Hegg
Sefan, 

Thanks for the help. I'm still not getting it to run, but I am not at all 
familiar with anything beyond running basic commands on the command console, 
I've mostly just used the GUI. Should these be input into the command console 
or the Python shell? I've tried both, the console seems to not recognize most 
of it, the Python shell gives me lots of syntax errors (which seems like a good 
start, I just don't know Python at all). 
Here is what I have:

points=$(v.db.select -c map=Fish_and_Water_PointsEPSG4140 column=cat))
for p in $points
do
v.extract --overwrite input=Fish_and_Water_PointsEPSG4140 
output=temp_point_map cat=(p) type=point
r.stream.basins direction=HenrysDrainage@HenrysFork 
points=temp_point_map basins=Basin_(p)  
done

The first error is a syntax error at the dollar sign in points=$(v.db.select... 

Am I getting close? The idea is that temp_point_map gets overwritten at each 
loop so all that remains is the last one. I'm wanting to name each new basin by 
the category so I can go back and figure out it's attribute data. 

Jens


On Feb 9, 2015, at 11:04 PM, Blumentrath, Stefan wrote:

> Hei Jens,
> 
> If you want to have watersheds which overlap, you have to have them in 
> different maps as neither raster nor vector data with topology (as in GRASS 
> GIS) allow for overlapping areas.
> That again means you would have to run r.stream.basins for your vector points 
> individually, e.g. in a loop like this:
> 
> points=$(v.db.select -c map=mypoints column=cat)
> for p in $points
> do
>   v.extract ...
>   r.stream.basisns ... 
> done
> 
> Cheers
> Stefan
> 
> -Original Message-
> From: grass-user-boun...@lists.osgeo.org 
> [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of Jens Hegg
> Sent: 10. februar 2015 05:32
> To: grass-user@lists.osgeo.org
> Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)
> 
> Ok,  I figured out how to make it work for the vector file. I was including 
> both the flow direction and the stream network along with the vector file. It 
> turns out that only the direction and vector outlets files are needed and 
> then it runs perfectly. The manual examples really should be updated to 
> include a vector points example.
> 
> I do still have one problem that someone might be able to help with. Many of 
> the points I use for outlets are just downstream of one another so it creates 
> watersheds that are just small slivers between points. Is it possible for it 
> to create overlapping watersheds as you move down the stream, or do I need to 
> go back and do this manually?
> 
> Jens
> 
> 
> 
> On Feb 9, 2015, at 6:08 PM, grass-user-requ...@lists.osgeo.org wrote:
> 
>> Send grass-user mailing list submissions to
>>  grass-user@lists.osgeo.org
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>>  http://lists.osgeo.org/mailman/listinfo/grass-user
>> or, via email, send a message with subject or body 'help' to
>>  grass-user-requ...@lists.osgeo.org
>> 
>> You can reach the person managing the list at
>>  grass-user-ow...@lists.osgeo.org
>> 
>> When replying, please edit your Subject line so it is more specific 
>> than "Re: Contents of grass-user digest..."
>> 
>> 
>> Today's Topics:
>> 
>>  1. Import/Export of ESRI Arc ascii grids (Thomas Adams)
>>  2. GRASS GIS 7.0.0 RC2 released (Markus Neteler)
>>  3. Re: Import/Export of ESRI Arc ascii grids (Markus Neteler)
>>  4. Re: Import/Export of ESRI Arc ascii grids
>> (C?sar Augusto Ram?rez Franco)
>>  5. Re: v.generalize: does it take forever? (F?bio Dias)
>>  6. r.stream.basins vector outlets help (Jens Hegg)
>> 
>> 

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


Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

2015-02-10 Thread Blumentrath, Stefan
Hi Jens,

Sorry, my fault. I should have asked you about your platform first.
Assuming you are on Windows I guess python would be most suitable language for 
scripting. Unfortunately I am not that good at python, but I am sure others 
will fill in.
You might need something like:
points = grass.read_command("v.to.db", map='YOUR_VECTOR_POINTS", columns='', 
option='coor', separator=',', flags='p')
for p in points.splitlines():
x=p.split(',')[2]
y= p.split(',')[3]
grass.run_comand('r.stream.basin', dirs=..., coors="%d,%d" % (x, y), 
...)

Good luck!
Stefan

-Original Message-
From: Jens Hegg [mailto:jensenh...@gmail.com] 
Sent: 10. februar 2015 21:22
To: Blumentrath, Stefan
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

Sefan, 

Thanks for the help. I'm still not getting it to run, but I am not at all 
familiar with anything beyond running basic commands on the command console, 
I've mostly just used the GUI. Should these be input into the command console 
or the Python shell? I've tried both, the console seems to not recognize most 
of it, the Python shell gives me lots of syntax errors (which seems like a good 
start, I just don't know Python at all). 
Here is what I have:

points=$(v.db.select -c map=Fish_and_Water_PointsEPSG4140 column=cat)) for p in 
$points do
v.extract --overwrite input=Fish_and_Water_PointsEPSG4140 
output=temp_point_map cat=(p) type=point
r.stream.basins direction=HenrysDrainage@HenrysFork 
points=temp_point_map basins=Basin_(p) done

The first error is a syntax error at the dollar sign in points=$(v.db.select... 

Am I getting close? The idea is that temp_point_map gets overwritten at each 
loop so all that remains is the last one. I'm wanting to name each new basin by 
the category so I can go back and figure out it's attribute data. 

Jens


On Feb 9, 2015, at 11:04 PM, Blumentrath, Stefan wrote:

> Hei Jens,
> 
> If you want to have watersheds which overlap, you have to have them in 
> different maps as neither raster nor vector data with topology (as in GRASS 
> GIS) allow for overlapping areas.
> That again means you would have to run r.stream.basins for your vector points 
> individually, e.g. in a loop like this:
> 
> points=$(v.db.select -c map=mypoints column=cat) for p in $points do
>   v.extract ...
>   r.stream.basisns ... 
> done
> 
> Cheers
> Stefan
> 
> -Original Message-
> From: grass-user-boun...@lists.osgeo.org 
> [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of Jens Hegg
> Sent: 10. februar 2015 05:32
> To: grass-user@lists.osgeo.org
> Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens 
> Hegg)
> 
> Ok,  I figured out how to make it work for the vector file. I was including 
> both the flow direction and the stream network along with the vector file. It 
> turns out that only the direction and vector outlets files are needed and 
> then it runs perfectly. The manual examples really should be updated to 
> include a vector points example.
> 
> I do still have one problem that someone might be able to help with. Many of 
> the points I use for outlets are just downstream of one another so it creates 
> watersheds that are just small slivers between points. Is it possible for it 
> to create overlapping watersheds as you move down the stream, or do I need to 
> go back and do this manually?
> 
> Jens
> 
> 
> 
> On Feb 9, 2015, at 6:08 PM, grass-user-requ...@lists.osgeo.org wrote:
> 
>> Send grass-user mailing list submissions to
>>  grass-user@lists.osgeo.org
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>>  http://lists.osgeo.org/mailman/listinfo/grass-user
>> or, via email, send a message with subject or body 'help' to
>>  grass-user-requ...@lists.osgeo.org
>> 
>> You can reach the person managing the list at
>>  grass-user-ow...@lists.osgeo.org
>> 
>> When replying, please edit your Subject line so it is more specific 
>> than "Re: Contents of grass-user digest..."
>> 
>> 
>> Today's Topics:
>> 
>>  1. Import/Export of ESRI Arc ascii grids (Thomas Adams)  2. GRASS 
>> GIS 7.0.0 RC2 released (Markus Neteler)  3. Re: Import/Export of ESRI 
>> Arc ascii grids (Markus Neteler)  4. Re: Import/Export of ESRI Arc 
>> ascii grids
>> (C?sar Augusto Ram?rez Franco)
>>  5. Re: v.generalize: does it take forever? (F?bio Dias)  6. 
>> r.stream.basins vector outlets help (Jens Hegg)
>> 
>> 

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


Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

2015-02-10 Thread Jens Hegg
I'm on a Mac, if that makes any difference. I will try this and see how it 
goes. 



Sent from my iPhone

> On Feb 10, 2015, at 3:06 PM, "Blumentrath, Stefan" 
>  wrote:
> 
> Hi Jens,
> 
> Sorry, my fault. I should have asked you about your platform first.
> Assuming you are on Windows I guess python would be most suitable language 
> for scripting. Unfortunately I am not that good at python, but I am sure 
> others will fill in.
> You might need something like:
> points = grass.read_command("v.to.db", map='YOUR_VECTOR_POINTS", columns='', 
> option='coor', separator=',', flags='p')
> for p in points.splitlines():
>x=p.split(',')[2]
>y= p.split(',')[3]
>grass.run_comand('r.stream.basin', dirs=..., coors="%d,%d" % (x, y), ...)
> 
> Good luck!
> Stefan
> 
> -Original Message-
> From: Jens Hegg [mailto:jensenh...@gmail.com] 
> Sent: 10. februar 2015 21:22
> To: Blumentrath, Stefan
> Cc: grass-user@lists.osgeo.org
> Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)
> 
> Sefan, 
> 
> Thanks for the help. I'm still not getting it to run, but I am not at all 
> familiar with anything beyond running basic commands on the command console, 
> I've mostly just used the GUI. Should these be input into the command console 
> or the Python shell? I've tried both, the console seems to not recognize most 
> of it, the Python shell gives me lots of syntax errors (which seems like a 
> good start, I just don't know Python at all). 
> Here is what I have:
> 
> points=$(v.db.select -c map=Fish_and_Water_PointsEPSG4140 column=cat)) for p 
> in $points do
>v.extract --overwrite input=Fish_and_Water_PointsEPSG4140 
> output=temp_point_map cat=(p) type=point
>r.stream.basins direction=HenrysDrainage@HenrysFork points=temp_point_map 
> basins=Basin_(p) done
> 
> The first error is a syntax error at the dollar sign in 
> points=$(v.db.select... 
> 
> Am I getting close? The idea is that temp_point_map gets overwritten at each 
> loop so all that remains is the last one. I'm wanting to name each new basin 
> by the category so I can go back and figure out it's attribute data. 
> 
> Jens
> 
> 
>> On Feb 9, 2015, at 11:04 PM, Blumentrath, Stefan wrote:
>> 
>> Hei Jens,
>> 
>> If you want to have watersheds which overlap, you have to have them in 
>> different maps as neither raster nor vector data with topology (as in GRASS 
>> GIS) allow for overlapping areas.
>> That again means you would have to run r.stream.basins for your vector 
>> points individually, e.g. in a loop like this:
>> 
>> points=$(v.db.select -c map=mypoints column=cat) for p in $points do
>>v.extract ...
>>r.stream.basisns ... 
>> done
>> 
>> Cheers
>> Stefan
>> 
>> -Original Message-
>> From: grass-user-boun...@lists.osgeo.org 
>> [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of Jens Hegg
>> Sent: 10. februar 2015 05:32
>> To: grass-user@lists.osgeo.org
>> Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens 
>> Hegg)
>> 
>> Ok,  I figured out how to make it work for the vector file. I was including 
>> both the flow direction and the stream network along with the vector file. 
>> It turns out that only the direction and vector outlets files are needed and 
>> then it runs perfectly. The manual examples really should be updated to 
>> include a vector points example.
>> 
>> I do still have one problem that someone might be able to help with. Many of 
>> the points I use for outlets are just downstream of one another so it 
>> creates watersheds that are just small slivers between points. Is it 
>> possible for it to create overlapping watersheds as you move down the 
>> stream, or do I need to go back and do this manually?
>> 
>> Jens
>> 
>> 
>> 
>>> On Feb 9, 2015, at 6:08 PM, grass-user-requ...@lists.osgeo.org wrote:
>>> 
>>> Send grass-user mailing list submissions to
>>>grass-user@lists.osgeo.org
>>> 
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>http://lists.osgeo.org/mailman/listinfo/grass-user
>>> or, via email, send a message with subject or body 'help' to
>>>grass-user-requ...@lists.osgeo.org
>>> 
>>> You can reach the person managing the list at
>>>grass-user-ow...@lists.osgeo.org
>>> 
>>> When replying, please edit your Subject line so it is more specific 
>>> than "Re: Contents of grass-user digest..."
>>> 
>>> 
>>> Today's Topics:
>>> 
>>> 1. Import/Export of ESRI Arc ascii grids (Thomas Adams)  2. GRASS 
>>> GIS 7.0.0 RC2 released (Markus Neteler)  3. Re: Import/Export of ESRI 
>>> Arc ascii grids (Markus Neteler)  4. Re: Import/Export of ESRI Arc 
>>> ascii grids
>>>(C?sar Augusto Ram?rez Franco)
>>> 5. Re: v.generalize: does it take forever? (F?bio Dias)  6. 
>>> r.stream.basins vector outlets help (Jens Hegg)
> 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

2015-02-10 Thread Blumentrath, Stefan
The advantage with python is that it is (more or less) platform independent.
What I send you first was a UNIX shell script for bash.
That obviously does not work on all UNIX like systems (like Mac in your case).
It might work if you change your terminal / shell to "bash" 
(http://osxdaily.com/2012/03/21/change-shell-mac-os-x/).
But python is more future oriented, anyway. So if you manage to make run in 
Python, that would be a better start into the world of scripting than starting 
with shell scripts (and then moving to Python at some point later (what I will 
have to - or more precisely like to- do sooner or later)...

For more info see e.g.: 
http://grasswiki.osgeo.org/wiki/GRASS_and_Python
http://grasswiki.osgeo.org/wiki/GRASS_Python_Scripting_Library

Cheers
Stefan
 

-Original Message-
From: Jens Hegg [mailto:jensenh...@gmail.com] 
Sent: 11. februar 2015 00:13
To: Blumentrath, Stefan
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens Hegg)

I'm on a Mac, if that makes any difference. I will try this and see how it 
goes. 



Sent from my iPhone

> On Feb 10, 2015, at 3:06 PM, "Blumentrath, Stefan" 
>  wrote:
> 
> Hi Jens,
> 
> Sorry, my fault. I should have asked you about your platform first.
> Assuming you are on Windows I guess python would be most suitable language 
> for scripting. Unfortunately I am not that good at python, but I am sure 
> others will fill in.
> You might need something like:
> points = grass.read_command("v.to.db", map='YOUR_VECTOR_POINTS", 
> columns='', option='coor', separator=',', flags='p') for p in 
> points.splitlines():
>x=p.split(',')[2]
>y= p.split(',')[3]
>grass.run_comand('r.stream.basin', dirs=..., coors="%d,%d" % (x, 
> y), ...)
> 
> Good luck!
> Stefan
> 
> -----Original Message-----
> From: Jens Hegg [mailto:jensenh...@gmail.com]
> Sent: 10. februar 2015 21:22
> To: Blumentrath, Stefan
> Cc: grass-user@lists.osgeo.org
> Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens 
> Hegg)
> 
> Sefan,
> 
> Thanks for the help. I'm still not getting it to run, but I am not at all 
> familiar with anything beyond running basic commands on the command console, 
> I've mostly just used the GUI. Should these be input into the command console 
> or the Python shell? I've tried both, the console seems to not recognize most 
> of it, the Python shell gives me lots of syntax errors (which seems like a 
> good start, I just don't know Python at all). 
> Here is what I have:
> 
> points=$(v.db.select -c map=Fish_and_Water_PointsEPSG4140 column=cat)) for p 
> in $points do
>v.extract --overwrite input=Fish_and_Water_PointsEPSG4140 
> output=temp_point_map cat=(p) type=point
>r.stream.basins direction=HenrysDrainage@HenrysFork 
> points=temp_point_map basins=Basin_(p) done
> 
> The first error is a syntax error at the dollar sign in 
> points=$(v.db.select... 
> 
> Am I getting close? The idea is that temp_point_map gets overwritten at each 
> loop so all that remains is the last one. I'm wanting to name each new basin 
> by the category so I can go back and figure out it's attribute data. 
> 
> Jens
> 
> 
>> On Feb 9, 2015, at 11:04 PM, Blumentrath, Stefan wrote:
>> 
>> Hei Jens,
>> 
>> If you want to have watersheds which overlap, you have to have them in 
>> different maps as neither raster nor vector data with topology (as in GRASS 
>> GIS) allow for overlapping areas.
>> That again means you would have to run r.stream.basins for your vector 
>> points individually, e.g. in a loop like this:
>> 
>> points=$(v.db.select -c map=mypoints column=cat) for p in $points do
>>v.extract ...
>>r.stream.basisns ... 
>> done
>> 
>> Cheers
>> Stefan
>> 
>> -Original Message-
>> From: grass-user-boun...@lists.osgeo.org
>> [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of Jens Hegg
>> Sent: 10. februar 2015 05:32
>> To: grass-user@lists.osgeo.org
>> Subject: Re: [GRASS-user] r.stream.basins vector outlets help (Jens
>> Hegg)
>> 
>> Ok,  I figured out how to make it work for the vector file. I was including 
>> both the flow direction and the stream network along with the vector file. 
>> It turns out that only the direction and vector outlets files are needed and 
>> then it runs perfectly. The manual examples really should be updated to 
>> include a vector points example.
>> 
>> I do still have one problem that someone might be able to help with. Many of 
>>