[GRASS-user] r.basin

2017-09-15 Thread Gabriel Garcia
Hello greetings.


I hope it's the right channel for the next query.

r.basin does not appear in the AddOns module of the GRASS GIS 7.2.1 screen
manager. must be executed directly on the command line, but it throws the
following:


[image: Imágenes integradas 1]

I downloaded the whole package that comes with QGIS on windows 10, 64 bit

I searched for information to the respesto but unfortunately I still do not
handle Python very well.

I would appreciate any clarification. regards
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin

2017-09-16 Thread Helmut Kudrnovsky
>r.basin does not appear in the AddOns module of the GRASS GIS 7.2.1 screen
manager.

have you installed the addon r.basin by g.extension?

>I downloaded the whole package that comes with QGIS on windows 10, 64 bit

addons have to be installed separately by g.extension, they aren't shipped
by QGIS/GRASS.

are other addons working for you. 

to start an addon you can also type the addon name into the wxGUI console.

to get more information why it fails, you can do

g.gisenv set=DEBUG=3

to see more debug messages.




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin

2017-09-16 Thread Helmut Kudrnovsky
>r.basin does not appear in the AddOns module of the GRASS GIS 7.2.1 screen
manager. must be executed >directly on the command line, but it throws the
following:

do you start the QGIS-bundled GRASS?

another nice way to get QGIS and GRASS for windows is: OSGeo4W. it's long
time tested, GRASS addons are used to work there.

[1] https://trac.osgeo.org/osgeo4w/



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin

2017-09-17 Thread Helmut Kudrnovsky
>However, I already manage to use r.basin module, but now it stays
>conjugated in: (next image)

[please keep conversation on the ML that others can help and benefit]

try the example listed in the manual to see whether the addon works
basically or if it's a problem of your location setting.



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] r.basin error

2018-10-22 Thread pelempito
Hi.

I tryed to run the r.basin addon for almost 4000 basins. Approximately 10%
of the basins end without the .csv parameters file. Digging deeper into the
command output, I spotted the following error at the end of the log from
r.basin:


Traceback (most recent call last):
  File "/home/jr/.grass7/addons/scripts/r.width.funct", line
132, in 
sys.exit(main())
  File "/home/jr/.grass7/addons/scripts/r.width.funct", line
85, in main
prc[2,0] , prc[2,1] = findint(kl,0.3) , 0.3
  File "/home/jr/.grass7/addons/scripts/r.width.funct", line
125, in findint
z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0],
kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1]
TypeError: only length-1 arrays can be converted to Python
scalars

--

An ERROR occurred running r.basin
Please check for error messages above or try with another pairs of outlet
coordinates


I think that r.basin stops after this error occurs, which may prevent
r.basin from generating the .csv parameter file for a given basin. I
researched a bit about the scalars in Python, and found  this post

  
(sorry for cross referencing), which refers that "non-numpy functions ...
don't play nicely with numpy arrays", but I couldn't make more follow up.

The error I just found can be reproduced by importing the raster DEM
included in  this ZIP file
   into
GRASS, and running the following command (I have more coordinates for which
r.basin fails as well):


r.basin --overwrite --verbose map=hydrodem prefix=cuenca13
coordinates=335595,2066655 threshold=22 dir=/tmp/tst


The raster is a subset of the tile Entity ID SRTM1N18W071V3, from the SRTM 1
Arc-Second Global DEM, post-treated by myself with the r.hydrodem addon.

I unsuccessfully tried to solve the issue by updating the region with both
the -a flag and the align parameter, since I read in the forum about that
trick as a possible workaround as well.

My GRASS region output is included below:


g.region -p 
projection: 1 (UTM)
zone:   19
datum:  wgs84
ellipsoid:  wgs84
north:  2068530
south:  2017320
west:   314970
east:   353400
nsres:  30
ewres:  30
rows:   1707
cols:   1281
cells:  2186667


And this is the r.info command output for the raster map hydrodem:


r.info map=hydrodem@PERMANENT   

++
 | Map:  hydrodem@PERMANENT Date: Mon Oct 22 10:04:29 2018   
|
 | Mapset:   PERMANENT  Login of Creator: jr 
|
 | Location: hydrodemocoa
|
 | DataBase: /home/jr/Documentos/grass/tst   
|
 | Title: ( hydrodem )   
|
 | Timestamp: none   
|

||
 |   
|
 |   Type of Map:  raster   Number of Categories: 0  
|
 |   Data Type:DCELL 
|
 |   Rows: 1707  
|
 |   Columns:  1281  
|
 |   Total Cells:  2186667   
|
 |Projection: UTM (zone 19)  
|
 |N:2068530S:2017320   Res:30
|
 |E: 353400W: 314970   Res:30
|
 |   Range of data:min = 0.946  max = 2340.517   
|
 |   
|
 |   Data Description:   
|
 |generated by r.in.gdal 
|
 |   
|
 |   Comments:   
|
 |r.in.gdal -e input="/home/jr/Documentos/grass/tst/hydrodem.tif" outp\  
|
 |ut="hydrodem" memory=300 offset=0  
|
 |   
|

++

I appreciate any help. I also would like to thank the developers for this
great addon.

Jose



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user 

[GRASS-user] r.basin error

2012-11-12 Thread kapo coulibaly
I'm trying to install r.basin addon and I'm getting the following error:
GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.4.2 sh
/usr/local/grass-6.4.2/tools/g.html2man
/root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/docs/html/r.basin.py.html
/root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/man/man1/r.basin.py.1
1
/usr/local/grass-6.4.2/tools/g.html2man:
/usr/local/grass-6.4.2/tools/g.html2man: is a directory
make[2]: ***
[/root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/man/man1/r.basin.py.1]
Error 126
make[2]: Leaving directory
`/root/test/scratch/.tmp/fmtslack64/26418.0/r.basin'
make[1]: *** [mancmd] Error 2
make[1]: Leaving directory
`/root/test/scratch/.tmp/fmtslack64/26418.0/r.basin'
make: ***
[/root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/scripts/
r.basin.py] Error 2
ERROR: Compilation failed, sorry. Please check above error messages.


I'm running slackware 13.37 64 bit and python 2.5.6


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


[GRASS-user] r.basin error

2012-11-28 Thread kapo coulibaly
I'm trying to run r.basin and I get the following error:
SECTION 1a (of 4): Initiating Memory.
SECTION 1b (of 4): Determining Offmap Flow.
SECTION 2: A * Search.
SECTION 3: Accumulating Surface Flow with SFD.
SECTION 4: Closing Maps.
Writing out only positive flow accumulation values.
Cells with a likely underestimate for flow accumulation can no longer be
identified.
Traceback (most recent call last):
  File "/home/user/grassdata/addons/r.basin", line 663, in

sys.exit(main())
  File "/home/user/grassdata/addons/r.basin", line 151, in
main
overwrite = True)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 189, in run_command
ps = start_command(*args, **kwargs)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 177, in start_command
return Popen(args, **popts)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 56, in __init__
startupinfo, creationflags)
  File "/usr/lib/python2.7/subprocess.py", line 679, in
__init__
errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in
_execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
(Wed Nov 28 19:36:58 2012) Command finished (20 sec)

I'm running the latest OSGeolive. But I got the exact same error on
Slackware 13 and CentOS 6

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


[GRASS-user] R.basin - feet?

2013-01-24 Thread Mark Seibel
Hi all.

Im working in coord system feet and DEM units feet.

I ran r.basin on a stream basin, and I noticed that it reports the basin
max/min elevation in meters, however, the values are really feet.

Has anyone done this with units of feet?  I see the program do feet/meter
conversion when running, but maybe that is just for the coord system units.
(?)

Does this mean I need the coord sys amd DEM units in meters, or just the
DEM units as meters?

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


[GRASS-user] r.basin matplotlib error

2015-04-30 Thread maning sambale
Hi,

I'm running r.basin using GRASS 6.4.4 from KyngChaos.

r.basin map=dem_90_int@PERMANENT prefix=out easting=712026.954
northing=1212651.537 threshold=40 --overwrite

I get this error, but the process continues.

out_dem_90_int_dist2out Done
##
Traceback (most recent call last):
  File "/Users/maning/Library/GRASS/6.4/Modules/bin/r.ipso", line 57,
in 
import matplotlib #required by windows
ImportError: No module named matplotlib
##
##
Traceback (most recent call last):
  File "/Users/maning/Library/GRASS/6.4/Modules/bin/r.wf", line 48, in 
import matplotlib #required by windows
ImportError: No module named matplotlib
##
Reading maps...

I was able to generate the maps and the Morphometric parameters.
What does this error mean and does it have any implication in the
Morphometric parameters results?



-- 
cheers,
maning
--
"Freedom is still the most radical idea of all" -N.Branden
https://epsg4253.wordpress.com/
http://twitter.com/maningsambale
--
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin error

2018-10-22 Thread Helmut Kudrnovsky
pelempito wrote
> Hi.
> 
> I tryed to run the r.basin addon for almost 4000 basins. Approximately 10%
> of the basins end without the .csv parameters file. Digging deeper into
> the
> command output, I spotted the following error at the end of the log from
> r.basin:
> 
> 
> Traceback (most recent call last):
>   File "/home/jr/.grass7/addons/scripts/r.width.funct", line
> 132, in 
> 
> sys.exit(main())
>   File "/home/jr/.grass7/addons/scripts/r.width.funct", line
> 85, in main
> prc[2,0] , prc[2,1] = findint(kl,0.3) , 0.3
>   File "/home/jr/.grass7/addons/scripts/r.width.funct", line
> 125, in findint
> z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0],
> kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1]
> TypeError: only length-1 arrays can be converted to Python
> scalars
> 
> --
> 
> An ERROR occurred running r.basin
> Please check for error messages above or try with another pairs of outlet
> coordinates
> 
> 
> I think that r.basin stops after this error occurs, which may prevent
> r.basin from generating the .csv parameter file for a given basin. I
> researched a bit about the scalars in Python, and found  this post
> ;
>   
> (sorry for cross referencing), which refers that "non-numpy functions ...
> don't play nicely with numpy arrays", but I couldn't make more follow up.
> 
> The error I just found can be reproduced by importing the raster DEM
> included in  this ZIP file
> ;  
> into
> GRASS, and running the following command (I have more coordinates for
> which
> r.basin fails as well):
> 
> 
> r.basin --overwrite --verbose map=hydrodem prefix=cuenca13
> coordinates=335595,2066655 threshold=22 dir=/tmp/tst
> 
> 
> The raster is a subset of the tile Entity ID SRTM1N18W071V3, from the SRTM
> 1
> Arc-Second Global DEM, post-treated by myself with the r.hydrodem addon.
> 
> I unsuccessfully tried to solve the issue by updating the region with both
> the -a flag and the align parameter, since I read in the forum about that
> trick as a possible workaround as well.

have a look into the created vector basin, for the coordinates mentioned
above:

Number of areas:2 

maybe there is some issue withe DEM?




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread pelempito
Thanks Helmut for your reply.

Certainly having two areas is not a desirable result, but I am not sure if
there is a problem with the DEM. One of the areas encompasses an isolated
pixel, which in fact is the basin outlet. This polygon is connected
diagonally with the other one, which is the main area of the basin. Is it an
issue of the DEM? The picture below shows the DEM cropped in the basin area,
as well as the polygons and the main channel:

 

Many of my basins have an outlet such as the one described above. Should I
move the outlets to the main area? Such a solution would be a bit
impractical. However, some basin outlets may fall on an isolated pixel,
which may not be considered as an error.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread Helmut Kudrnovsky
pelempito wrote
> Thanks Helmut for your reply.
> 
> Certainly having two areas is not a desirable result, but I am not sure if
> there is a problem with the DEM. One of the areas encompasses an isolated
> pixel, which in fact is the basin outlet. This polygon is connected
> diagonally with the other one, which is the main area of the basin. Is it
> an
> issue of the DEM? The picture below shows the DEM cropped in the basin
> area,
> as well as the polygons and the main channel:
> 
> ; 
> 
> Many of my basins have an outlet such as the one described above. Should I
> move the outlets to the main area? Such a solution would be a bit
> impractical. However, some basin outlets may fall on an isolated pixel,
> which may not be considered as an error.
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list

> grass-user@.osgeo

> https://lists.osgeo.org/mailman/listinfo/grass-user


---
"/home/jr/.grass7/addons/scripts/r.width.funct", line 
125, in findint 
z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0], 
kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1] 
TypeError: only length-1 arrays can be converted to Python 
scalars 
--

maybe it's not an DEM issue.

looking on your error, the issue arises in r.width.funct.

Not checked the code, AFAIR there may be some instability if there are 2
polygones. Have look into the source.

Do you maybe have some finer DEM for this region to test?



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread pelempito
Thanks.

I think the same as you, that the problem arises in r.width.funct.

Unfortunately, I don't have a finer DEM for this region.

I appreciate your help.

Best regards.

Jose



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread Margherita Di Leo
Hi Jose,

Have you checked the cases where r.basin fails? Are they all cases of
outlet falling in isolated pixels? R.basin can’t handle those, however it’s
important to understand if there are other problems. Please check a sample
of the failing cases. Try also to move the outlet of some pixels and run
again. Note that it doesn’t handle overwrite, you have to delete the output
manually.

Hope this helps

Il giorno lun 22 ott 2018 alle 21:30 pelempito 
ha scritto:

> Thanks Helmut for your reply.
>
> Certainly having two areas is not a desirable result, but I am not sure if
> there is a problem with the DEM. One of the areas encompasses an isolated
> pixel, which in fact is the basin outlet. This polygon is connected
> diagonally with the other one, which is the main area of the basin. Is it
> an
> issue of the DEM? The picture below shows the DEM cropped in the basin
> area,
> as well as the polygons and the main channel:
>
> 
>
> Many of my basins have an outlet such as the one described above. Should I
> move the outlets to the main area? Such a solution would be a bit
> impractical. However, some basin outlets may fall on an isolated pixel,
> which may not be considered as an error.
>
>
>
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user

-- 
Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-23 Thread Margherita Di Leo
Jose,

could you try if r73602 makes some difference?

On Tue, Oct 23, 2018 at 8:25 AM Margherita Di Leo 
wrote:

> Hi Jose,
>
> Have you checked the cases where r.basin fails? Are they all cases of
> outlet falling in isolated pixels? R.basin can’t handle those, however it’s
> important to understand if there are other problems. Please check a sample
> of the failing cases. Try also to move the outlet of some pixels and run
> again. Note that it doesn’t handle overwrite, you have to delete the output
> manually.
>
> Hope this helps
>
> Il giorno lun 22 ott 2018 alle 21:30 pelempito 
> ha scritto:
>
>> Thanks Helmut for your reply.
>>
>> Certainly having two areas is not a desirable result, but I am not sure if
>> there is a problem with the DEM. One of the areas encompasses an isolated
>> pixel, which in fact is the basin outlet. This polygon is connected
>> diagonally with the other one, which is the main area of the basin. Is it
>> an
>> issue of the DEM? The picture below shows the DEM cropped in the basin
>> area,
>> as well as the polygons and the main channel:
>>
>> 
>>
>> Many of my basins have an outlet such as the one described above. Should I
>> move the outlets to the main area? Such a solution would be a bit
>> impractical. However, some basin outlets may fall on an isolated pixel,
>> which may not be considered as an error.
>>
>>
>>
>> --
>> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>
> --
> Margherita Di Leo
>


-- 
Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-23 Thread Jose Ramon
Hi Margherita and thanks for your reply.

In attention to your comment, I delved a little deeper in the issue. What I
found is that many other subbasins have a "normally" placed outlet. Below I
include an example of such a situation (the subbasin is depicted in pink,
and the black dot stands for the outlet):

 

This case may be reproduced with the following code using the DEM provided
in the first message of the thread:
r.basin --overwrite --verbose map=hydrodem prefix=cuenca903
coordinates=322605,2055705 threshold=22 dir=/tmp/tst/903

Definitely, I couldn't find a common pattern for all the subbasins having
the issue.

I think that maybe the issue arises when the g.region command is called,
which may prevent r.width.funct or other addons to run smoothly.

I am not sure if this helps, but below I included two partial views of the
command output of r.basin. The one on the left side is a successful run; the
one on the right shows a failure when r.width.funct starts to run.

 

Finally, I installed the updated version of r.width.funct (which includes
the itemgetter function and other changes) and the issue is still there, but
now it also fails with basins that previously worked well for me.

I appreciate any suggestion.

Best regards.

Jose.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-23 Thread Jose Ramon
Hi again.

I tried a workaround, which is not perfect, but at least allows me to get
the CSV file, which is my main interest by now.

I commented the lines that calls r.width.funct in the r.basin script, so
lines 344-347 looks like this.
#grass.message( "--" )

#grass.run_command('r.width.funct', map = r_distance,
#  image = os.path.join(directory,prefix))

I used this version with 5 known "problematic" basins and it generated the
CSV files successfully. Obviously, it didn't generate the width function
plot, but it is not a major concern for me now.

I will try to use this version with the 4000 basins (will take maybe 10
hours or less), and will let you know if new issues arises. Would like to
run this in parallel (from within R using rgrass7 package), but I
unsuccessfully tried this approach days before. I guess that since r.basin
calls g.region for each basin, it is impossible to have consistent results
when running it in parallel.

Thanks in advance for any suggestions regarding the issues with
r.width.funct.

Best regards.

Jose




--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] r.basin: Two Questions

2012-10-31 Thread Rich Shepard

  The morphometric parameters calculated by r.basin include mean slope and
magnitudo and I'd like clarification of these two.

  The mean slope of the main channel is presented as percent; is 'mean
slope' also in percent? Also, is mean slope measured along the prevalent
oreientation from outlet to highest point on the watershed boundary?

  I assume that magnitudo is Italian and the English equivalent is
magnitude. Is this a correct assumption? In any case, magnitude of what is
calculated?

Rich

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


Re: [GRASS-user] r.basin error

2012-11-12 Thread Markus Neteler
On Mon, Nov 12, 2012 at 7:01 PM, kapo coulibaly  wrote:
> I'm trying to install r.basin addon and I'm getting the following error:
> GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.4.2 sh
> /usr/local/grass-6.4.2/tools/g.html2man
> /root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/docs/html/r.basin.py.html
> /root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/man/man1/r.basin.py.1
> 1
> /usr/local/grass-6.4.2/tools/g.html2man:
> /usr/local/grass-6.4.2/tools/g.html2man: is a directory

This should not be a directory. Could you please check what's inside?

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


Re: [GRASS-user] r.basin error

2012-11-12 Thread kapo coulibaly
inside /usr/local/grass-6.4.2/tools/g.html2man there is a file called
g.html2man. I moved it outside and deleted the folder with the same name.
After that r.basin installed without error. But when I try to run it get:

GRASS 6.4.2 (test):/usr/local/grass-6.4.2/tools > r.basin
/root/.grass6/addons/r.basin:572: Warning: 'with' will become a reserved
keyword in Python 2.6
  File "/root/.grass6/addons/r.basin", line 572
with open(prefix+'_parameters.csv', 'w') as f:
^
SyntaxError: invalid syntax


On Mon, Nov 12, 2012 at 2:43 PM, Markus Neteler  wrote:

> On Mon, Nov 12, 2012 at 7:01 PM, kapo coulibaly 
> wrote:
> > I'm trying to install r.basin addon and I'm getting the following error:
> > GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.4.2 sh
> > /usr/local/grass-6.4.2/tools/g.html2man
> >
> /root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/docs/html/r.basin.py.html
> >
> /root//test/scratch/.tmp/fmtslack64/26418.0/dist.x86_64-slackware-linux-gnu/man/man1/r.basin.py.1
> > 1
> > /usr/local/grass-6.4.2/tools/g.html2man:
> > /usr/local/grass-6.4.2/tools/g.html2man: is a directory
>
> This should not be a directory. Could you please check what's inside?
>
> thanks
> Markus
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin error

2012-11-13 Thread Margherita Di Leo
Hi,

On Tue, Nov 13, 2012 at 6:17 AM, kapo coulibaly  wrote:

> inside /usr/local/grass-6.4.2/tools/g.html2man there is a file called
> g.html2man. I moved it outside and deleted the folder with the same name.
> After that r.basin installed without error. But when I try to run it get:
>
> GRASS 6.4.2 (test):/usr/local/grass-6.4.2/tools > r.basin
> /root/.grass6/addons/r.basin:572: Warning: 'with' will become a reserved
> keyword in Python 2.6
>   File "/root/.grass6/addons/r.basin", line 572
> with open(prefix+'_parameters.csv', 'w') as f:
> ^
> SyntaxError: invalid syntax


 This is due to Python 2.5.x, you need to upgrade to 2.6 in order to run
r.basin.

Best regards,
m


-- 
Margherita DI LEO
Postdoctoral Researcher
European Commission - DG JRC
Forest Resources and Climate
I-21020 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin error

2012-11-28 Thread Rich Shepard

On Wed, 28 Nov 2012, kapo coulibaly wrote:


 File "/usr/lib/grass64/etc/python/grass/script/core.py",
 File "/usr/lib/python2.7/subprocess.py", line 1249, in


  These are python errors. do you have core.py and subprocess.py on your
systems? I'm still running python-2.6 on my Slackware hosts so it might be a
python-2.7 issue.

Rich

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


Re: [GRASS-user] r.basin error

2012-11-28 Thread Margherita Di Leo
Hi,

On Wed, Nov 28, 2012 at 8:46 PM, kapo coulibaly  wrote:

> I'm trying to run r.basin and I get the following error:
> SECTION 1a (of 4): Initiating Memory.
> SECTION 1b (of 4): Determining Offmap Flow.
> SECTION 2: A * Search.
> SECTION 3: Accumulating Surface Flow with SFD.
> SECTION 4: Closing Maps.
> Writing out only positive flow accumulation values.
> Cells with a likely underestimate for flow accumulation can no longer be
> identified.
> Traceback (most recent call last):
>   File "/home/user/grassdata/addons/r.basin", line 663, in
> 
> sys.exit(main())
>   File "/home/user/grassdata/addons/r.basin", line 151, in
> main
> overwrite = True)
>   File "/usr/lib/grass64/etc/python/grass/script/core.py",
> line 189, in run_command
> ps = start_command(*args, **kwargs)
>   File "/usr/lib/grass64/etc/python/grass/script/core.py",
> line 177, in start_command
> return Popen(args, **popts)
>   File "/usr/lib/grass64/etc/python/grass/script/core.py",
> line 56, in __init__
> startupinfo, creationflags)
>   File "/usr/lib/python2.7/subprocess.py", line 679, in
> __init__
> errread, errwrite)
>   File "/usr/lib/python2.7/subprocess.py", line 1249, in
> _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
> (Wed Nov 28 19:36:58 2012) Command finished (20 sec)
>
> I'm running the latest OSGeolive. But I got the exact same error on
> Slackware 13 and CentOS 6
>

What's the exact command line that you are trying to run? Could you
reproduce this error using NC dataset so that I can reproduce it as well?

Thanks,
madi

>
>

-- 
Margherita DI LEO
Postdoctoral Researcher
European Commission - DG JRC
Forest Resources and Climate
I-21020 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin error

2012-12-04 Thread kapo coulibaly
The command using NC data on OSGEOLive 6.0 is attached. Thanks
(Tue Dec  4 14:13:38
2012)
r.basin -a map=elevation@PERMANENT prefix=ncbasin easting=641154
northing=222423
SECTION 1a (of 4): Initiating Memory.
SECTION 1b (of 4): Determining Offmap Flow.
SECTION 2: A * Search.
SECTION 3: Accumulating Surface Flow with SFD.
SECTION 4: Closing Maps.
Writing out only positive flow accumulation values.
Cells with a likely underestimate for flow accumulation can no longer be
identified.
threshold : 1.0
Traceback (most recent call last):
  File "/home/user/grassdata/addons/r.basin", line 663, in

sys.exit(main())
  File "/home/user/grassdata/addons/r.basin", line 151, in
main
overwrite = True)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 189, in run_command
ps = start_command(*args, **kwargs)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 177, in start_command
return Popen(args, **popts)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 56, in __init__
startupinfo, creationflags)
  File "/usr/lib/python2.7/subprocess.py", line 679, in
__init__
errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in
_execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
(Tue Dec  4 14:14:03 2012) Command finished (24
sec)


On Thu, Nov 29, 2012 at 7:56 AM, Margherita Di Leo wrote:

> Hi,
>
> On Wed, Nov 28, 2012 at 8:46 PM, kapo coulibaly wrote:
>
>> I'm trying to run r.basin and I get the following error:
>> SECTION 1a (of 4): Initiating Memory.
>> SECTION 1b (of 4): Determining Offmap Flow.
>> SECTION 2: A * Search.
>> SECTION 3: Accumulating Surface Flow with SFD.
>> SECTION 4: Closing Maps.
>> Writing out only positive flow accumulation values.
>> Cells with a likely underestimate for flow accumulation can no longer be
>> identified.
>> Traceback (most recent call last):
>>   File "/home/user/grassdata/addons/r.basin", line 663, in
>> 
>> sys.exit(main())
>>   File "/home/user/grassdata/addons/r.basin", line 151, in
>> main
>> overwrite = True)
>>   File "/usr/lib/grass64/etc/python/grass/script/core.py",
>> line 189, in run_command
>> ps = start_command(*args, **kwargs)
>>   File "/usr/lib/grass64/etc/python/grass/script/core.py",
>> line 177, in start_command
>> return Popen(args, **popts)
>>   File "/usr/lib/grass64/etc/python/grass/script/core.py",
>> line 56, in __init__
>> startupinfo, creationflags)
>>   File "/usr/lib/python2.7/subprocess.py", line 679, in
>> __init__
>> errread, errwrite)
>>   File "/usr/lib/python2.7/subprocess.py", line 1249, in
>> _execute_child
>> raise child_exception
>> OSError: [Errno 2] No such file or directory
>> (Wed Nov 28 19:36:58 2012) Command finished (20 sec)
>>
>> I'm running the latest OSGeolive. But I got the exact same error on
>> Slackware 13 and CentOS 6
>>
>
> What's the exact command line that you are trying to run? Could you
> reproduce this error using NC dataset so that I can reproduce it as well?
>
> Thanks,
> madi
>
>>
>>
>
> --
> Margherita DI LEO
> Postdoctoral Researcher
> European Commission - DG JRC
> Forest Resources and Climate
> I-21020 Ispra (VA) - Italy - TP 261
>
> Tel. +39 0332 78 3600
> margherita.di-...@jrc.ec.europa.eu
>
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin error

2012-12-04 Thread Margherita Di Leo
Hi,

On Tue, Dec 4, 2012 at 3:19 PM, kapo coulibaly  wrote:

> The command using NC data on OSGEOLive 6.0 is attached. Thanks
> (Tue Dec  4 14:13:38
> 2012)
> r.basin -a map=elevation@PERMANENT prefix=ncbasin easting=641154
> northing=222423


Thank you, I'll check it later this evening and let you know. Just one
further information: do you have r.stream.* modules (dependencies) already
installed?

Best regards,
MaDi

>
>

-- 
Margherita DI LEO
Postdoctoral Researcher
European Commission - DG JRC
Forest Resources and Climate
I-21020 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin error

2012-12-04 Thread kapo coulibaly
You are right. installing the r.stream.* seems to have taken care of it.
thanks

On Tue, Dec 4, 2012 at 10:47 AM, Margherita Di Leo wrote:

> Hi,
>
> On Tue, Dec 4, 2012 at 3:19 PM, kapo coulibaly  wrote:
>
>> The command using NC data on OSGEOLive 6.0 is attached. Thanks
>> (Tue Dec  4 14:13:38
>> 2012)
>> r.basin -a map=elevation@PERMANENT prefix=ncbasin easting=641154
>> northing=222423
>
>
> Thank you, I'll check it later this evening and let you know. Just one
> further information: do you have r.stream.* modules (dependencies) already
> installed?
>
> Best regards,
> MaDi
>
>>
>>
>
> --
> Margherita DI LEO
> Postdoctoral Researcher
> European Commission - DG JRC
> Forest Resources and Climate
> I-21020 Ispra (VA) - Italy - TP 261
>
> Tel. +39 0332 78 3600
> margherita.di-...@jrc.ec.europa.eu
>
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin error

2012-12-04 Thread Margherita Di Leo
Anyway I'll add some controls to let it crash more graciously whenever a
dependency is missing. Many thanks for your feedback.

On Tue, Dec 4, 2012 at 5:18 PM, kapo coulibaly  wrote:

> You are right. installing the r.stream.* seems to have taken care of it.
> thanks
>
>
> On Tue, Dec 4, 2012 at 10:47 AM, Margherita Di Leo wrote:
>
>> Hi,
>>
>> On Tue, Dec 4, 2012 at 3:19 PM, kapo coulibaly wrote:
>>
>>> The command using NC data on OSGEOLive 6.0 is attached. Thanks
>>> (Tue Dec  4 14:13:38
>>> 2012)
>>> r.basin -a map=elevation@PERMANENT prefix=ncbasin easting=641154
>>> northing=222423
>>
>>
>> Thank you, I'll check it later this evening and let you know. Just one
>> further information: do you have r.stream.* modules (dependencies) already
>> installed?
>>
>> Best regards,
>> MaDi
>>
>>>
>>>
>>
>> --
>> Margherita DI LEO
>> Postdoctoral Researcher
>> European Commission - DG JRC
>> Forest Resources and Climate
>> I-21020 Ispra (VA) - Italy - TP 261
>>
>> Tel. +39 0332 78 3600
>> margherita.di-...@jrc.ec.europa.eu
>>
>>
>>
>


-- 
Margherita DI LEO
Postdoctoral Researcher
European Commission - DG JRC
Forest Resources and Climate
I-21020 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] R.basin - feet?

2013-02-04 Thread Mark Seibel
Following-up to my earlier post...

> I'm working in coord system feet and DEM units feet.
>
> I ran r.basin on a stream basin, and I noticed that it reports the basin
> max/min elevation in meters, however, the values are really feet.
>
> Has anyone done this with units of feet?  I see the program do feet/meter
> conversion when running, but maybe that is just for the coord system units.
> (?)
>

I realize this only applies to a fraction of participants, but maybe it
would help someone.

I noticed language in the r.sim.sediment and r.sim.water modules which
mention that the horizontal units are converted to meters.  It also states
that the elevation needs to be in meters.

Using coordinate system of feet, but DEM units of meters for r.basin, I
verified that at least two parameters are correctly calculated:  Stream
length and basin elevations.

If I use DEM units of feet, it reports that the elevations are in meters,
but the values are actually feet.

Please note I have not confirmed the findings in the actual source code,
just from some quick observations of the module output.

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


Re: [GRASS-user] R.basin - feet?

2013-02-04 Thread Margherita Di Leo
Mark,

On Mon, Feb 4, 2013 at 3:38 PM, Mark Seibel  wrote:

> Following-up to my earlier post...
>
>> I'm working in coord system feet and DEM units feet.
>>
>> I ran r.basin on a stream basin, and I noticed that it reports the basin
>> max/min elevation in meters, however, the values are really feet.
>>
>> Has anyone done this with units of feet?  I see the program do feet/meter
>> conversion when running, but maybe that is just for the coord system units.
>> (?)
>>
>
> I realize this only applies to a fraction of participants, but maybe it
> would help someone.
>
> I noticed language in the r.sim.sediment and r.sim.water modules which
> mention that the horizontal units are converted to meters.  It also states
> that the elevation needs to be in meters.
>
> Using coordinate system of feet, but DEM units of meters for r.basin, I
> verified that at least two parameters are correctly calculated:  Stream
> length and basin elevations.
>
> If I use DEM units of feet, it reports that the elevations are in meters,
> but the values are actually feet.
>
> Please note I have not confirmed the findings in the actual source code,
> just from some quick observations of the module output.
>

Thank you for your comments. As r.basin relies on a bunch of modules, and
since I'm not really close to the matter of feet, I can't provide any
answer. BTW, it seems to me that the issue that you raised is of general
interest for GRASS, because it would be nice to guarantee a consistency
among the modules, or at the very least document how they behave in this
regard.

Thanks
MaDi

>
>
>

-- 
Margherita DI LEO
Postdoctoral Researcher

European Commission - DG JRC
Institute for Environment and Sustainability (IES). Unit H03 – FRC
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not
in any circumstance be regarded as stating an official position of the
European Commission.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin matplotlib error

2015-04-30 Thread Margherita Di Leo
Dear Maning,

On Thu, Apr 30, 2015 at 10:11 AM, maning sambale  wrote:

> Hi,
>
> I'm running r.basin using GRASS 6.4.4 from KyngChaos.
>
> r.basin map=dem_90_int@PERMANENT prefix=out easting=712026.954
> northing=1212651.537 threshold=40 --overwrite
>
> I get this error, but the process continues.
>
> out_dem_90_int_dist2out Done
> ##
> Traceback (most recent call last):
>   File "/Users/maning/Library/GRASS/6.4/Modules/bin/r.ipso", line 57,
> in 
> import matplotlib #required by windows
> ImportError: No module named matplotlib
> ##
> ##
> Traceback (most recent call last):
>   File "/Users/maning/Library/GRASS/6.4/Modules/bin/r.wf", line 48, in
> 
> import matplotlib #required by windows
> ImportError: No module named matplotlib
> ##
> Reading maps...
>
> I was able to generate the maps and the Morphometric parameters.
> What does this error mean and does it have any implication in the
> Morphometric parameters results?
>

Matplotlib is a dependency needed for the graphic output, being the
hypsographic curve and the width function. If you don't need those
graphics, this error will not affect the result that you get. For what
concerns the reason why this dependency is missing in windows, I don't
know, perhaps packaging issue?

Best,
Margherita

>
>
>
> --
> cheers,
> maning
> --
> "Freedom is still the most radical idea of all" -N.Branden
> https://epsg4253.wordpress.com/
> http://twitter.com/maningsambale
> --
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>



-- 
Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not
in any circumstance be regarded as stating an official position of the
European Commission.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin matplotlib error

2015-04-30 Thread maning sambale
Dear Margherita,

Thanks!

On Thu, Apr 30, 2015 at 4:35 PM, Margherita Di Leo  wrote:
> Matplotlib is a dependency needed for the graphic output, being the
> hypsographic curve and the width function. If you don't need those graphics,
> this error will not affect the result that you get. For what concerns the
> reason why this dependency is missing in windows, I don't know, perhaps
> packaging issue?

This is what I suspect.  I'm sure I have matplotlib installed (might
be some conflicting packages), will investigate further.
Not a biggie for not getting the graphics (would be nice to have of
course) as long as the results are OK.

Thanks again!



-- 
cheers,
maning
--
"Freedom is still the most radical idea of all" -N.Branden
https://epsg4253.wordpress.com/
http://twitter.com/maningsambale
--
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin matplotlib error

2015-04-30 Thread Margherita Di Leo
Maning

On Thu, Apr 30, 2015 at 10:51 AM, maning sambale  wrote:

> Dear Margherita,
>
> Thanks!
>
> On Thu, Apr 30, 2015 at 4:35 PM, Margherita Di Leo 
> wrote:
> > Matplotlib is a dependency needed for the graphic output, being the
> > hypsographic curve and the width function. If you don't need those
> graphics,
> > this error will not affect the result that you get. For what concerns the
> > reason why this dependency is missing in windows, I don't know, perhaps
> > packaging issue?
>
> This is what I suspect.  I'm sure I have matplotlib installed (might
> be some conflicting packages), will investigate further.
> Not a biggie for not getting the graphics (would be nice to have of
> course) as long as the results are OK.
>

Sorry reading again your email I realized that you are not on windows as I
mentioned. I don't have a clue of what KyngChaos is. However my reply still
applies, except for the windows part.

Cheers,
Margherita


-- 
Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not
in any circumstance be regarded as stating an official position of the
European Commission.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] r.basin not running completely

2020-04-24 Thread jomaljochan
Hi, I am a new GRASS GIS User (using GRASS GIS 7.6.1) trying to get the
morphometric parameters of a watershed(Bhadra river basin, India).
Steps followed:
1) Cropped and set the DEM file in UTM projection.
2) Created a new location and used the georeferenced DEM file to set the
projection of GRASS Session.
3) Ran the following lines of code:

  g.region rast=elevation@PERMANENT -ap

  r.watershed -a elevation=elevation@PERMANENT accumulation=accum

  r.stream.extract elevation=elevation@PERMANENT accumulation=accum
threshold=1000 
  stream_rast=stream_network stream_vect=streams --overwrite
  #(overwrite with different threshold until clear network)

  #Find the coordinates of the outlet from network and input in r.basin fn

  r.basin map=elevation@PERMANENT prefix=out
coordinates=572957.585125,1547823.44718 
  threshold=20 dir=tmp/my_basin  



The function stops running with the following error:

  ERROR: option : 
exists. To overwrite, use the 
  --overwrite flag

  --

  An ERROR occurred running r.basin
  Please check for error messages above or try with another pairs of outlet
coordinates
  Removing region definition 



The details of the input DEM raster is:
++
 | Map:  elevation@PERMANENTDate: Sat Apr 25 11:48:17 2020   
|
 | Mapset:   PERMANENT  Login of Creator: Jomal Jochan   
|
 | Location: Test_run_check  
|
 | DataBase: D:\STUDIES\sem8\Watershed Project\grassdata 
|
 | Title:elevation   
|
 | Timestamp: none   
|

||
 |   
|
 |   Type of Map:  raster   Number of Categories: 0  
|
 |   Data Type:CELL  
|
 |   Rows: 1755  
|
 |   Columns:  1785  
|
 |   Total Cells:  3132675   
|
 |Projection: UTM (zone 43)  
|
 |N: 1548050.1657S: 1495414.5575   Res: 29.99179954  
|
 |E: 605402.3491W: 551850.8938   Res: 30.00081529
|
 |   Range of data:min = 552  max = 1737 
|
 |   
|
 |   Data Description:   
|
 |generated by r.in.gdal 
|
 |   
|
 |   Comments:   
|
 |r.in.gdal -e input="D:\STUDIES\sem8\Watershed Project\Bhadra_sample_\  
|
 |files\Input DEM\elevation.tif" output="elevation" memory=300 offset=\  
|
 |0 num_digits=0 
|
 |   
|

++
(Sat Apr 25 12:14:49 2020) Command finished (0 sec) 



The output of the first line of code is given for your reference:

  g.region rast=elevation@PERMANENT -ap 
  
  projection: 1 (UTM)
  zone:   43
  datum:  wgs84
  ellipsoid:  wgs84
  north:  1548050.1657
  south:  1495414.5575 
  west:   551850.8938
  east:   605402.3491
  nsres:  29.99179954
  ewres:  30.00081529
  rows:   1755
  cols:   1785
  cells:  3132675

Any help is greatly appreciated! Thanks in advance!



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] r.basin Issues Needing Resolution

2012-04-06 Thread Rich Shepard

  I have several questions about r.basin that I hope can be quickly
answered.

  1.) Is there an example that can be added to the manual page? I would like
to better understand the prefix and threshold parameters.

  2.) There are several module dependencies, but r.stream.basin, r.wf.py,
and r.ipso.py cannot be downloaded and installed using g.extension; they're
not found in the addon repository.

  3.) The r.stream.extract module is not working for my projects' data using
version 6.5svn on linux. I have detailed vector maps of the stream networks
in each of the subbasins I need to describe and model. If I run v.to.rast on
these maps can I use the outlet cell as the values for the easting and
northing parameters to the command?

Thanks,

Rich

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


[GRASS-user] r.basin morphometry, part 2

2012-10-31 Thread Rich Shepard

  If for one basin defined by r.basin the Horton area ration is 0., and
for another basin the Horton slope ration is infinite, what have I done
incorrectly in defining the outlets of these basins? In both cases the rest
of the morphometric parameters look rational.

TIA,

Rich

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


Re: [GRASS-user] r.basin not running completely

2020-04-25 Thread Margherita Di Leo
cc list

On Sat, Apr 25, 2020 at 9:11 AM Margherita Di Leo 
wrote:

> Hi,
>
> On Sat, Apr 25, 2020 at 8:49 AM jomaljochan 
> wrote:
>
>> Hi, I am a new GRASS GIS User (using GRASS GIS 7.6.1) trying to get the
>> morphometric parameters of a watershed(Bhadra river basin, India).
>> Steps followed:
>> 1) Cropped and set the DEM file in UTM projection.
>> 2) Created a new location and used the georeferenced DEM file to set the
>> projection of GRASS Session.
>> 3) Ran the following lines of code:
>>
>>   g.region rast=elevation@PERMANENT -ap
>>
>>   r.watershed -a elevation=elevation@PERMANENT accumulation=accum
>>
>>   r.stream.extract elevation=elevation@PERMANENT accumulation=accum
>> threshold=1000
>>   stream_rast=stream_network stream_vect=streams --overwrite
>>   #(overwrite with different threshold until clear network)
>>
>>   #Find the coordinates of the outlet from network and input in r.basin fn
>>
>>   r.basin map=elevation@PERMANENT prefix=out
>> coordinates=572957.585125,1547823.44718
>>   threshold=20 dir=tmp/my_basin
>>
>>
>>
>> The function stops running with the following error:
>>
>>   ERROR: option : 
>> exists. To overwrite, use the
>>   --overwrite flag
>>
>>   --
>>
>>   An ERROR occurred running r.basin
>>   Please check for error messages above or try with another pairs of
>> outlet
>> coordinates
>>   Removing region definition 
>>
>> The command is telling you that an output with the same name is already
> there. You need to delete it* and run the command again.
>
> *Sorry r.basin doesn't handle overwrite, as written in the manual.
>
> Hope this helps.
>
> Kind regards,
>
>
> --
> Margherita Di Leo
>


-- 
Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin not running completely

2020-04-25 Thread jomaljochan
Hi,
Thank you for your interest and time!

I had created a whole new location and ran the code only once. And it is
still showing the same. Moreover, the file in question is nowhere to be
found.

Is there any other possibility?



margherita wrote
> cc list
> 
> On Sat, Apr 25, 2020 at 9:11 AM Margherita Di Leo <

> diregola@

> >
> wrote:
> 
>> Hi,
>>
>> On Sat, Apr 25, 2020 at 8:49 AM jomaljochan <

> jochanjomal1998@

> >
>> wrote:
>>
>>> Hi, I am a new GRASS GIS User (using GRASS GIS 7.6.1) trying to get the
>>> morphometric parameters of a watershed(Bhadra river basin, India).
>>> Steps followed:
>>> 1) Cropped and set the DEM file in UTM projection.
>>> 2) Created a new location and used the georeferenced DEM file to set the
>>> projection of GRASS Session.
>>> 3) Ran the following lines of code:
>>>
>>>   g.region rast=elevation@PERMANENT -ap
>>>
>>>   r.watershed -a elevation=elevation@PERMANENT accumulation=accum
>>>
>>>   r.stream.extract elevation=elevation@PERMANENT accumulation=accum
>>> threshold=1000
>>>   stream_rast=stream_network stream_vect=streams --overwrite
>>>   #(overwrite with different threshold until clear network)
>>>
>>>   #Find the coordinates of the outlet from network and input in r.basin
>>> fn
>>>
>>>   r.basin map=elevation@PERMANENT prefix=out
>>> coordinates=572957.585125,1547823.44718
>>>   threshold=20 dir=tmp/my_basin
>>>
>>>
>>>
>>> The function stops running with the following error:
>>>
>>>   ERROR: option 
> 
> : 
>>> exists. To overwrite, use the
>>>   --overwrite flag
>>>
>>>   --
>>>
>>>   An ERROR occurred running r.basin
>>>   Please check for error messages above or try with another pairs of
>>> outlet
>>> coordinates
>>>   Removing region definition 
> 
>>>
>>> The command is telling you that an output with the same name is already
>> there. You need to delete it* and run the command again.
>>
>> *Sorry r.basin doesn't handle overwrite, as written in the manual.
>>
>> Hope this helps.
>>
>> Kind regards,
>>
>>
>> --
>> Margherita Di Leo
>>
> 
> 
> -- 
> Margherita Di Leo
> 
> ___
> grass-user mailing list

> grass-user@.osgeo

> https://lists.osgeo.org/mailman/listinfo/grass-user





--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin not running completely

2020-04-25 Thread Margherita Di Leo
On Sat, Apr 25, 2020 at 9:39 AM jomaljochan 
wrote:

> Hi,
> Thank you for your interest and time!
>
> I had created a whole new location and ran the code only once. And it is
> still showing the same. Moreover, the file in question is nowhere to be
> found.
>
> Is there any other possibility?
>

(sorry, again I had accidentally excluded the list from cc)
Maybe try giving it a different prefix and a different folder where to
write the output
Hope this helps

>
>
>
> margherita wrote
> > cc list
> >
> > On Sat, Apr 25, 2020 at 9:11 AM Margherita Di Leo <
>
> > diregola@
>
> > >
> > wrote:
> >
> >> Hi,
> >>
> >> On Sat, Apr 25, 2020 at 8:49 AM jomaljochan <
>
> > jochanjomal1998@
>
> > >
> >> wrote:
> >>
> >>> Hi, I am a new GRASS GIS User (using GRASS GIS 7.6.1) trying to get the
> >>> morphometric parameters of a watershed(Bhadra river basin, India).
> >>> Steps followed:
> >>> 1) Cropped and set the DEM file in UTM projection.
> >>> 2) Created a new location and used the georeferenced DEM file to set
> the
> >>> projection of GRASS Session.
> >>> 3) Ran the following lines of code:
> >>>
> >>>   g.region rast=elevation@PERMANENT -ap
> >>>
> >>>   r.watershed -a elevation=elevation@PERMANENT accumulation=accum
> >>>
> >>>   r.stream.extract elevation=elevation@PERMANENT accumulation=accum
> >>> threshold=1000
> >>>   stream_rast=stream_network stream_vect=streams --overwrite
> >>>   #(overwrite with different threshold until clear network)
> >>>
> >>>   #Find the coordinates of the outlet from network and input in r.basin
> >>> fn
> >>>
> >>>   r.basin map=elevation@PERMANENT prefix=out
> >>> coordinates=572957.585125,1547823.44718
> >>>   threshold=20 dir=tmp/my_basin
> >>>
> >>>
> >>>
> >>> The function stops running with the following error:
> >>>
> >>>   ERROR: option
> > 
> > : 
> >>> exists. To overwrite, use the
> >>>   --overwrite flag
> >>>
> >>>   --
> >>>
> >>>   An ERROR occurred running r.basin
> >>>   Please check for error messages above or try with another pairs of
> >>> outlet
> >>> coordinates
> >>>   Removing region definition
> > 
> >>>
> >>> The command is telling you that an output with the same name is already
> >> there. You need to delete it* and run the command again.
> >>
> >> *Sorry r.basin doesn't handle overwrite, as written in the manual.
> >>
> >> Hope this helps.
> >>
> >> Kind regards,
> >>
> >>
> >> --
> >> Margherita Di Leo
> >>
> >
> >
> > --
> > Margherita Di Leo
> >
> > ___
> > grass-user mailing list
>
> > grass-user@.osgeo
>
> > https://lists.osgeo.org/mailman/listinfo/grass-user
>
>
>
>
>
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user



-- 
Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin Issues Needing Resolution

2012-04-07 Thread Margherita Di Leo
Hi Rich,

On Sat, Apr 7, 2012 at 12:23 AM, Rich Shepard wrote:

>  I have several questions about r.basin that I hope can be quickly
> answered.
>
>  1.) Is there an example that can be added to the manual page? I would like
> to better understand the prefix and threshold parameters.
>

r.basin produces several maps for every run, which are flow direction,
accumulation, Horton ordered streams etc.. Prefix parameter is simply a
string given by the user in order to distinguish all the maps produced by a
single run of the program, i.e. every set of coords for outlet. For
example,

r.basin.py map=elevation@PERMANENT prefix=out easting=636654.791181
northing=218824.126649 threshold=20

will produce output maps named:

# raster
out_elevation_accumulation
out_elevation_aspect
out_elevation_dist2out
out_elevation_distance
out_elevation_drainage
out_elevation_hack
out_elevation_hillslope_distance
out_elevation_horton
out_elevation_shreve
out_elevation_slope
out_elevation_strahler

# vector
out_elevation_basin
out_elevation_mainchannel
out_elevation_network
out_elevation_outlet

Threshold parameter is the same of r.watershed. 'Autothreshold ' flag'
simply uses a threshold area of 1 km^2 and is intended as a tentative.


>  2.) There are several module dependencies, but r.stream.basin, r.wf.py,
> and r.ipso.py cannot be downloaded and installed using g.extension;
> they're
> not found in the addon repository.
>

For what concerns r.stream.basin, it is a typo in the documentation,
correct is r.stream.basins, thanks for pointing me out, I just updated it
in the description file.
r.wf.py and r.ipso.py are in the addOns repository:

http://grass.osgeo.org/wiki/GRASS_AddOns#r.wf
http://grass.osgeo.org/wiki/GRASS_AddOns#r.ipso

I can't see any obvious error in the Makefile. maybe an experienced dev
could please check why they are not working with g.extension.

>
>  3.) The r.stream.extract module is not working for my projects' data using
> version 6.5svn on linux. I have detailed vector maps of the stream networks
> in each of the subbasins I need to describe and model. If I run v.to.rast
> on
> these maps can I use the outlet cell as the values for the easting and
> northing parameters to the command?
>

Please note that r.basin is intended to work with only one outlet at time.
This means you should script it in a for cycle if you run it for several
outlets. You can't give to r.basin the coordinates directly from a vector
map.
I have indicated to run r.stream.extract before r.basin because most of the
times the calculated stream network doesn't match with the natural one, so
that your coordinates should be adjusted to match the calculated stream
network in order to get a result from r.basin. By the way, in a first run
you can give a try with your coordinates.

HTH,
madi

>
> Thanks,
>
> Rich
>
> __**_
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/grass-user
>



-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin Issues Needing Resolution

2012-04-07 Thread Margherita Di Leo
On Sat, Apr 7, 2012 at 10:16 AM, Margherita Di Leo wrote:

> Hi Rich,
>
>
>
>>  2.) There are several module dependencies, but r.stream.basin, r.wf.py,
>> and r.ipso.py cannot be downloaded and installed using g.extension;
>> they're
>> not found in the addon repository.
>>
>
How do you run g.extension?
g.extension extension=r.ipso -s
g.extension extension=r.wf -s
works for me in G6.5 on debian.

-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin Issues Needing Resolution

2012-04-07 Thread Rich Shepard

On Sat, 7 Apr 2012, Margherita Di Leo wrote:


r.basin produces several maps for every run, which are flow direction,
accumulation, Horton ordered streams etc.. Prefix parameter is simply a
string given by the user in order to distinguish all the maps produced by a
single run of the program, i.e. every set of coords for outlet. For
example,


madi,

  I thought this is the case, but wanted to know rather than assume.


Threshold parameter is the same of r.watershed. 'Autothreshold ' flag'
simply uses a threshold area of 1 km^2 and is intended as a tentative.


  Again, rather than assuming I wanted to be sure I understood.


For what concerns r.stream.basin, it is a typo in the documentation,
correct is r.stream.basins, thanks for pointing me out, I just updated it
in the description file.
r.wf.py and r.ipso.py are in the addOns repository:


  Ah, I see why they did not download for me: I added the .py extention to
the g.estension command. Now I know to leave it off.


Please note that r.basin is intended to work with only one outlet at time.
This means you should script it in a for cycle if you run it for several
outlets.


  I understand this.


 You can't give to r.basin the coordinates directly from a vector map.


  But, can I use the coordinates of a rasterized stream network?


I have indicated to run r.stream.extract before r.basin because most of the
times the calculated stream network doesn't match with the natural one, so
that your coordinates should be adjusted to match the calculated stream
network in order to get a result from r.basin. By the way, in a first run
you can give a try with your coordinates.


  The outputs of r.stream.extract on two different project sub-watersheds
are, as far as I can see on the display, only about 5-10% of the vector
stream network, and all at the lower ends of the basins in which they
appear. I can send screen shots if you'd like to see the differences.

  After downloading and building the 'missing' three modules I'll try
v.to.rast on the natural stream network (at 1:24,000 scale, just like the
elevation data) and see what r.basin tells me.

Many thanks,

Rich

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


Re: [GRASS-user] r.basin Issues Needing Resolution

2012-04-07 Thread Margherita Di Leo
Rich,

I just created a wiki page [1] on the use of r.basin, with an example from
NC dataset. Hope this would make the usage clear. If you have any further
question don't hesitate to ask.

Best,
madi

[1]http://grass.osgeo.org/wiki/R.basin
-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin Issues Needing Resolution

2012-04-07 Thread Margherita Di Leo
Rich,

On Sat, Apr 7, 2012 at 3:51 PM, Rich Shepard wrote:

> On Sat, 7 Apr 2012, Margherita Di Leo wrote:
>
>  r.basin produces several maps for every run, which are flow direction,
>> accumulation, Horton ordered streams etc.. Prefix parameter is simply a
>> string given by the user in order to distinguish all the maps produced by
>> a
>> single run of the program, i.e. every set of coords for outlet. For
>> example,
>>
>
> madi,
>
>  I thought this is the case, but wanted to know rather than assume.
>
>
>  Threshold parameter is the same of r.watershed. 'Autothreshold ' flag'
>> simply uses a threshold area of 1 km^2 and is intended as a tentative.
>>
>
>  Again, rather than assuming I wanted to be sure I understood.
>
>
>  For what concerns r.stream.basin, it is a typo in the documentation,
>> correct is r.stream.basins, thanks for pointing me out, I just updated it
>> in the description file.
>> r.wf.py and r.ipso.py are in the addOns repository:
>>
>
>  Ah, I see why they did not download for me: I added the .py extention to
> the g.estension command. Now I know to leave it off.
>
>
>  Please note that r.basin is intended to work with only one outlet at time.
>> This means you should script it in a for cycle if you run it for several
>> outlets.
>>
>
>  I understand this.
>
>
>   You can't give to r.basin the coordinates directly from a vector map.
>>
>
>  But, can I use the coordinates of a rasterized stream network?


No. Do you think this would be an useful add? If so, I could work on it
when I have some spare time.. Let me know.

>
>
>  I have indicated to run r.stream.extract before r.basin because most of
>> the
>> times the calculated stream network doesn't match with the natural one, so
>> that your coordinates should be adjusted to match the calculated stream
>> network in order to get a result from r.basin. By the way, in a first run
>> you can give a try with your coordinates.
>>
>
>  The outputs of r.stream.extract on two different project sub-watersheds
> are, as far as I can see on the display, only about 5-10% of the vector
> stream network, and all at the lower ends of the basins in which they
> appear. I can send screen shots if you'd like to see the differences.
>

AFAICT this could be due to an odd value for the threshold, or a g.region
or mask related problem. Please try setting g.region to match the elevation
map, removing the mask and setting a lower threshold value.

>
>  After downloading and building the 'missing' three modules I'll try
> v.to.rast on the natural stream network (at 1:24,000 scale, just like the
> elevation data) and see what r.basin tells me.
>

Let me know about your results.

madi

>
> Many thanks,
>
>
> Rich
>
> __**_
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/grass-user
>



-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] r.basin input using r.stream.extract output

2012-04-26 Thread Rich Shepard

  The r.basin command line needs the geographic coordinates of the basin
outlet, and these should be derived from r.stream.extract. When I look at
the stream output from r.stream.extract (both vector and raster) with the
HUC-12 vector boundary I see what appear to be four different outlets of the
basin (see attached chicken_creek.pdf). I refer to them as north, west,
south, and southeast.

  Do I take this to mean that there are four basins identified by
r.stream.extract to be described by r.basin?  For my current projects, the
HUC-12 subbasins are the appropriate analytical units; finer resolution will
add confusion rather than clarity because this is all in a regulatory
context. My last question, then, is how do I pick an outlet point so r.basin
describes the area within the vector boundary in the attached figure as a
single basin?

  The streams seem to cross the HUC-12 basin boundary at each of these
potential basin outlet points. How should I interpret these results?

  On one project I have 12 subbasins like this one; the other project has 4
subbasins.

Rich

chicken_creek.pdf
Description: Adobe PDF document
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin input using r.stream.extract output

2012-04-26 Thread Margherita Di Leo
Hi Rich,

On Thu, Apr 26, 2012 at 5:40 PM, Rich Shepard wrote:

>  The r.basin command line needs the geographic coordinates of the basin
> outlet, and these should be derived from r.stream.extract. When I look at
> the stream output from r.stream.extract (both vector and raster) with the
> HUC-12 vector boundary I see what appear to be four different outlets of
> the
> basin (see attached chicken_creek.pdf). I refer to them as north, west,
> south, and southeast.


>  Do I take this to mean that there are four basins identified by
> r.stream.extract to be described by r.basin?  For my current projects, the
> HUC-12 subbasins are the appropriate analytical units; finer resolution
> will
> add confusion rather than clarity because this is all in a regulatory
> context. My last question, then, is how do I pick an outlet point so
> r.basin
> describes the area within the vector boundary in the attached figure as a
> single basin?
>
>  The streams seem to cross the HUC-12 basin boundary at each of these
> potential basin outlet points. How should I interpret these results?
>
>  On one project I have 12 subbasins like this one; the other project has 4
> subbasins.


What you get by r.basin is the basin defined by the entire upslope area
drained by the river system into the closing section (outlet) that you
indicate by the coordinates in input. The vector layer that I can see in
your attached file doesn't look like a basin but a  portion of a sub-basin
which doesn't include the sources (the points where actually the river
begins). If you are trying to reproduce that, r.basin is not the
appropriate tool. Technically, I think the correct term of what you are
trying to delineate is inter-basin (but english native speakers can give me
an insight), while r.basin only can delineate basins and sub-basins.

HTH,
madi

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


-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] r.basin ? for plane geometry of polygon shapefiles

2012-06-05 Thread Marco Jorge
Hi,

I have 10k small polygons stored in a shapefile and in raster format (nr 
classes = nr of basins).   
I am interested in getting some planar geometry information for each polygon.
I have 3 problems, not considering the lack of knowledge: 

- no DTM; 
- no channels; 
- try to foul r.basin with the shapefile

Can you think of a way to pick the module and its code to calculate the indices 
in the end of the post? 
Can anyone point me a way to pick up the major axis instead of the lenght of 
the main channel ? 
Any hint on major (or minor) axis extraction?

Should I try other approach? 

Thanks in advance
Marco


"
* The circularity ratio: is the ratio between the area of the basin and 
the area of the circle having the same perimeter of the basin.
* The elongation ratio: is the ratio between the diameter of the circle 
having the same area of the basin and the length of the main channel.
* The compactness coefficient: is the ratio between the perimeter of 
the basin and the diameter of the circle having the same area of the basin.
* The shape factor: is the ratio between the area of the basin and the 
square of the length of the main channel
"___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] r.basin: specifying closing point by geographic coordinates

2012-10-24 Thread Rich Shepard

  I have geographic coordinates for monitoring locations near the mouthes of
streams. Can I apply r.basin to each individual basin without using the
r.extract[ed] coordinates?

Rich

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


[GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-06 Thread Rich Shepard

  Running r.basin using r.to.vect basin boundaries and r.to.vect
r.stream.extract weighted streams (but same issue using unweighted streams).
So far, of 7 sub-basins on which I've run the module only 4 complete
successfully. The other three go through the entire process then fail with
the error message that the outlet needs to be on a stream channel created by
r.stream.extract.

  I use the same protocol on each sub-basin: zoom in very close to where the
sub-basin boundary and stream channel cross, then note the x, y coordinates
from the status line on the display window frame.

  What might account for this same process, using the same r.stream.extract
map, to work on some sub-basins and fail on others?

Rich

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


Re: [GRASS-user] r.basin ? for plane geometry of polygon shapefiles

2012-06-07 Thread Margherita Di Leo
Hi Marco,

On Tue, Jun 5, 2012 at 4:54 PM, Marco Jorge  wrote:

> Hi,
>
> I have 10k small polygons stored in a shapefile and in raster format (nr
> classes = nr of basins).
> I am interested in getting some planar geometry information for each
> polygon.
>
I have 3 problems, not considering the lack of knowledge:
>
> - no DTM;
> - no channels;
> - try to foul r.basin with the shapefile
>
> Can you think of a way to pick the module and its code to calculate the
> indices in the end of the post?
> Can anyone point me a way to pick up the major axis instead of the lenght
> of the main channel ?
> Any hint on major (or minor) axis extraction?
>
> Should I try other approach?
>

To me, it's not clear what you are trying to get. If your aim is to perform
a hydrological analysis, you do need a DEM, and you can easily download
i.e. an ASTER GDEM for your area and then use r.basin. If your analysis
it's not related to hydrology, and you just need some "shape indexes", what
you should do is probably related to what you are trying to achieve..  Can
you explain a little more?

Regards,
madi


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


Re: [GRASS-user] r.basin ? for plane geometry of polygon shapefiles

2012-06-07 Thread Marco
Hi Margherita,

Grazie. Its not related to hydrology. I just want to get some shape indexes to 
characterize networks of polygons (periglacial patterned ground).

I came to your Grass Add-on because the indexes used in 2D basin morphometry 
are really adequate to characterize each individual polygon.


I have already used SAGA GIS and GVSig, which automatically supply shape 
parameters relating the perimeter of the polygon to its area in various ways. 
And that´s already fine information. 

From that I know if the polygon is more elongated or more circular. And maybe 
more information won´t add to much... But I still would like to try. Mainly 
because of the indexes which grab the axis and  which relate the polygon to and 
ideal shape. 

Maybe I should focus on doing one thing at a time: 1) axis calculation; and 2) 
deriving the ideal shape from the centroid of the polygon.Then I´d have great 
information. 


My next step is to go inside you python code (of which I know little) and try 
to extract the relevant pieces. 

Thank you.
Marco

(gonna start a MSc related to cryosphere geomorphology next Fall)






 From: Margherita Di Leo 
To: Marco Jorge  
Cc: "grass-user@lists.osgeo.org"  
Sent: Thursday, June 7, 2012 11:26 AM
Subject: Re: [GRASS-user] r.basin ? for plane geometry of polygon shapefiles
 

Hi Marco,


On Tue, Jun 5, 2012 at 4:54 PM, Marco Jorge  wrote:

Hi,
>
>
>I have 10k small polygons stored in a shapefile and in raster format (nr 
>classes = nr of basins).   
>I am interested in getting some planar geometry information for each polygon.
I have 3 problems, not considering the lack of knowledge: 
>
>
>- no DTM; 
>- no channels; 
>- try to foul r.basin with the shapefile
>
>
>Can you think of a way to pick the module and its code to calculate the 
>indices in the end of the post? 
>Can anyone point me a way to pick up the major axis instead of the lenght of 
>the main channel ? 
>Any hint on major (or minor) axis extraction?
>
>
>Should I try other approach? 

To me, it's not clear what you are trying to get. If your aim is to perform a 
hydrological analysis, you do need a DEM, and you can easily download i.e. an 
ASTER GDEM for your area and then use r.basin. If your analysis it's not 
related to hydrology, and you just need some "shape indexes", what you should 
do is probably related to what you are trying to achieve..  Can you explain a 
little more?

Regards,
madi

-- 
Dr. Margherita Di Leo___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin ? for plane geometry of polygon shapefiles

2012-06-07 Thread Margherita Di Leo
Marco,

On Thu, Jun 7, 2012 at 1:15 PM, Marco  wrote:

> Hi Margherita,
>
> Grazie. Its not related to hydrology. I just want to get some shape
> indexes to characterize networks of polygons (periglacial patterned ground).
> I came to your Grass Add-on because the indexes used in 2D basin
> morphometry are really adequate to characterize each individual polygon.
>
> I have already used SAGA GIS and GVSig, which automatically supply shape
> parameters relating the perimeter of the polygon to its area in various
> ways. And that´s already fine information.
> From that I know if the polygon is more elongated or more circular. And
> maybe more information won´t add to much... But I still would like to try.
> Mainly because of the indexes which grab the axis and  which relate the
> polygon to and ideal shape.
>
> Maybe I should focus on doing one thing at a time: 1) axis calculation;
> and 2) deriving the ideal shape from the centroid of the polygon. Then
> I´d have great information.
>

Have you seen v.to.db[1]? It allows you to calculate some parameters such
as area, perimeter, compactness, fractal dimension, etc.

>
> My next step is to go inside you python code (of which I know little) and
> try to extract the relevant pieces.
>

The code is quite self-explanatory and the formulas are very simple so that
you could also calculate some parameters in a spreadsheet, anyways if you
need further information don't hesitate to ask.

>
> Thank you.
> Marco
> (gonna start a MSc related to cryosphere geomorphology next Fall)
>

Congrats ;-)

ciao madi

[1] http://grass.osgeo.org/gdp/html_grass64/v.to.db.html
-- 
Dr. Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin ? for plane geometry of polygon shapefiles

2012-06-08 Thread Marco
Solved

Thank you. 
I found good solutions. .
gvSIG is part of it. It delivers straightforwardly the minimum circle and 
minimum rectangle for a group of points (the vertices) per class of points 
(number of polygon). 

Cheers,
Marco



 From: Margherita Di Leo 
To: Marco  
Cc: "grass-user@lists.osgeo.org"  
Sent: Thursday, June 7, 2012 1:26 PM
Subject: Re: [GRASS-user] r.basin ? for plane geometry of polygon shapefiles
 

Marco,


On Thu, Jun 7, 2012 at 1:15 PM, Marco  wrote:

Hi Margherita,
>
>
>Grazie. Its not related to hydrology. I just want to get some shape indexes to 
>characterize networks of polygons (periglacial patterned ground).
>
>I came to your Grass Add-on because the indexes used in 2D basin morphometry 
>are really adequate to characterize each individual polygon.
>
>
>
>I have already used SAGA GIS and GVSig, which automatically supply shape 
>parameters relating the perimeter of the polygon to its area in various ways. 
>And that´s already fine information. 
>
>From that I know if the polygon is more elongated or more circular. And maybe 
>more information won´t add to much... But I still would like to try. Mainly 
>because of the indexes which grab the axis and  which relate the polygon to 
>and ideal shape. 
>
>
>Maybe I should focus on doing one thing at a time: 1) axis calculation; and 2) 
>deriving the ideal shape from the centroid of the polygon.Then I´d have great 
>information. 
>

Have you seen v.to.db[1]? It allows you to calculate some parameters such as 
area, perimeter, compactness, fractal dimension, etc. 

>
>My next step is to go inside you python code (of which I know little) and try 
>to extract the relevant pieces. 

The code is quite self-explanatory and the formulas are very simple so that you 
could also calculate some parameters in a spreadsheet, anyways if you need 
further information don't hesitate to ask. 

>
>Thank you.
>Marco
>
>(gonna start a MSc related to cryosphere geomorphology next Fall)

Congrats ;-)

ciao madi
 
[1] http://grass.osgeo.org/gdp/html_grass64/v.to.db.html-- 
Dr. Margherita Di Leo___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: specifying closing point by geographic coordinates

2012-10-24 Thread Margherita Di Leo
Hi Rich,

On Wed, Oct 24, 2012 at 4:56 PM, Rich Shepard wrote:

>   I have geographic coordinates for monitoring locations near the mouthes
> of
> streams. Can I apply r.basin to each individual basin without using the
> r.extract[ed] coordinates?
>
>
> As a general remark, you can always give a try with the coordinates that
you already have, because it can happen that those exactly match the
extracted river network, even if it is unlikely. By the way, i've never
tested the script using lat/lon coordinates, but i suppose that you can get
some of the parameters in a unit derived from degrees, which is not
correct, so you need to use metric coordinates in order to get a suitable
result. BTW, if you are willing to make a test on it and send (maybe
privately) to me the results, I'll appreciate. Thus I'll update the
documentation accordingly.

Thanks and regards.

madi



-- 
Margherita DI LEO
Postdoctoral Researcher
European Commission - DG JRC
Forest Resources and Climate
I-21020 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: specifying closing point by geographic coordinates

2012-10-24 Thread Rich Shepard

On Wed, 24 Oct 2012, Margherita Di Leo wrote:


As a general remark, you can always give a try with the coordinates that
you already have, because it can happen that those exactly match the
extracted river network, even if it is unlikely.


madi,

  These are locations where water and benthic macroinvertebrates were
collected so if they're not exactly on the stream, they can easily be moved
to overlap the line without loss of ecological information.


By the way, i've never tested the script using lat/lon coordinates, but i
suppose that you can get some of the parameters in a unit derived from
degrees, which is not correct, so you need to use metric coordinates in
order to get a suitable result.


  The original measurements are in lat/lon but after importing to that
locations they were re-projected to the project location which uses the
State Plane Coordinate System projection; the units are in metres.

  I assume that if I provide one set of easting/northing coordinates the
script will run only once and define that specific drainage basin for me.
This assumption will be tested and results forwarded per your request below.


BTW, if you are willing to make a test on it and send (maybe privately) to
me the results, I'll appreciate. Thus I'll update the documentation
accordingly.


  Certainly.

Rich

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


Re: [GRASS-user] r.basin: specifying closing point by geographic coordinates

2012-10-24 Thread Helmut Kudrnovsky
>By the way, i've never tested the script using lat/lon coordinates, but i
suppose that you can get >some of the parameters in a unit derived from
degrees, which is not correct,

once I've run the script in a lat/lon-wgs84-location, the results are odd.

>so you need to use metric coordinates in order to get a suitable result.

yes



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/r-basin-specifying-closing-point-by-geographic-coordinates-tp5010864p5010896.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] r.basin does not complete properly on one stream

2012-10-25 Thread Rich Shepard

  For a reason I've not been able to determine in a long day today r.basin
fails to properly complete when passed easting/northing coordinates of a
cell generated by r.stream.extract. The last three ratios are shown as NAN
and the area is shown as only 4km^2 when it's actually much larger. With
other sub-basins this result was corrected by moving the outlet point
further upstream from the confluence with a larger stream.

  Following the r.basin wiki that madi wrote, I re-extracted the streams
from the DEM. Ran r.watershed to generate an accumulation map, then
r.stream.extract. Both modules take the same DEM map (named dem_proj). But,
when I place the outlet point several cells above the confluence r.basin
does not properly complete. I tried moving the outlet away from the
confluence, but still no joy.

  The attached PDF shows the outlet point sitting in the middle of a cell on
the stream_network raster generated by r.stream.extract.

  I'm at a loss to understand why this one sub-basin is fighting me, and I
would like outside opinions on what might be the cause and suggestions of
what to try to isolate the cause of this problem. If more information is
desired, I'll try to provide it.

Rich

stream-map.pdf
Description: Adobe PDF document
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-06 Thread Helmut Kudrnovsky
>The other three go through the entire process then fail with
>the error message that the outlet needs to be on a stream channel created
by
>r.stream.extract.
>

AFAIK from my r.basin-tests the outlet-point has to be exactly on stream
channel created by r.stream.extract

>   I use the same protocol on each sub-basin: zoom in very close to where
> the
>sub-basin boundary and stream channel cross, then note the x, y coordinates
>from the status line on the display window frame. 

maybe following ML-disscussion could be helpfull to find the exact crossing
of stream and boundary:

[GRASS-user] intersection between two lines vector to obtain points:

http://lists.osgeo.org/pipermail/grass-user/2012-March/064062.html
http://lists.osgeo.org/pipermail/grass-user/2012-March/064063.html

and then v.to.db to upload exact x,y-coordinates in the attribute table




-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979607.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-06 Thread Rich Shepard

On Wed, 6 Jun 2012, Helmut Kudrnovsky wrote:


maybe following ML-disscussion could be helpfull to find the exact
crossing of stream and boundary:

[GRASS-user] intersection between two lines vector to obtain points:
http://lists.osgeo.org/pipermail/grass-user/2012-March/064062.html


  What v.clean tool should be used in this case?

Thanks, Helmut,

Rich

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-06 Thread Helmut Kudrnovsky
v.clean tool=break

-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979644.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Margherita Di Leo
Helmut,

would you mind to write your suggestion in the r.basin wiki page[1]?
Thanks!

ciao madi


[1] http://grass.osgeo.org/wiki/R.basin

On Thu, Jun 7, 2012 at 8:24 AM, Helmut Kudrnovsky  wrote:

> v.clean tool=break
>
> -
> best regards
> Helmut
> --
>



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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Sylvain Maillard
Hi,

I get a similar issue some time ago (but with a vector input) and wrote a
little script to work only with raster (no need to transform back to vector)

it's using r.distance (
http://grass.osgeo.org/grass64/manuals/html64_user/r.distance.html), wich
"Locates the closest points between objects in two raster maps" and output
an ascii line with the intersection point ...
you just need to input your 2 raster with basin boundaries and streams, and
it will do the job for all your objects at once ;)

Cheers,
Sylvain



2012/6/6 Rich Shepard 

>  Running r.basin using r.to.vect basin boundaries and r.to.vect
> r.stream.extract weighted streams (but same issue using unweighted
> streams).
> So far, of 7 sub-basins on which I've run the module only 4 complete
> successfully. The other three go through the entire process then fail with
> the error message that the outlet needs to be on a stream channel created
> by
> r.stream.extract.
>
>  I use the same protocol on each sub-basin: zoom in very close to where the
> sub-basin boundary and stream channel cross, then note the x, y coordinates
> from the status line on the display window frame.
>
>  What might account for this same process, using the same r.stream.extract
> map, to work on some sub-basins and fail on others?
>
> Rich
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Helmut Kudrnovsky
>would you mind to write your suggestion in the r.basin wiki page[1]?
>Thanks!

sure, it's taken from http://www.surfaces.co.il/?p=241

-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979663.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Helmut Kudrnovsky
>would you mind to write your suggestion in the r.basin wiki page[1]?

done, please expand if needed

-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979677.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Rich Shepard

On Wed, 6 Jun 2012, Helmut Kudrnovsky wrote:


v.clean tool=break


Helmut,

  Good. That's what I chose.

Thanks,

Rich

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Helmut Kudrnovsky
>> v.clean tool=break
>
>Helmut,
>
>   Good. That's what I chose. 

now there is a new and related wiki-entry (section Preparation, last
paragraph)

http://grass.osgeo.org/wiki/R.basin#Preparation



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979751.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Micha Silver

  
  
On 06/07/2012 12:16 PM, Helmut Kudrnovsky wrote:

  
would you mind to write your suggestion in the r.basin wiki page[1]?

  
  
done, please expand if needed



Hi Helmut:
I think you had a typo between the names crosspoints and
crosspointscat in one line. I took the liberty of fixing, and
changing a few other layer names for readability. If you could have
a look to be sure it still reads correctly?

The next addition might be how feed these crosspoints X and Y
straight into the easting and northing of r.basins...
 
BTW, thanks for mentioning my blog earlier in the thread :-) 

Regards,
Micha


  
-
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979677.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.






  

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Margherita Di Leo
Hi Micha,

The next addition might be how feed these crosspoints X and Y straight into
> the easting and northing of r.basins...
>
>
you mean something like (untested):

#!/usr/bin/env python

fin = open("crosspoints","r")
fout = open("commands","w")
linesout = (line.rstrip().split() for line in fin)
cmd = 'r.basin map=dem prefix=bas%s easting=%s northing=%s
threshold=1\n'
fout.writelines(cmd % (n, easting, northing) for n,(easting,northing) in
enumerate(linesout))

?

ciao madi


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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread David Montoya
Hi, I run the example of r.basin and I get this message at the end:

Traceback (most recent call last):
  File "/home/admin-lsc/Grass/Modulos/r.basin.py", line 427, in 
sys.exit(main())
  File "/home/admin-lsc/Grass/Modulos/r.basin.py", line 235, in main
mainchannel = float(dict_mainchannel['Length']) / 1000
KeyError: 'Length'


On Wed, Jun 6, 2012 at 5:12 PM, Helmut Kudrnovsky  wrote:

> >The other three go through the entire process then fail with
> >the error message that the outlet needs to be on a stream channel created
> by
> >r.stream.extract.
> >
>
> AFAIK from my r.basin-tests the outlet-point has to be exactly on stream
> channel created by r.stream.extract
>
> >   I use the same protocol on each sub-basin: zoom in very close to where
> > the
> >sub-basin boundary and stream channel cross, then note the x, y
> coordinates
> >from the status line on the display window frame.
>
> maybe following ML-disscussion could be helpfull to find the exact crossing
> of stream and boundary:
>
> [GRASS-user] intersection between two lines vector to obtain points:
>
> http://lists.osgeo.org/pipermail/grass-user/2012-March/064062.html
> http://lists.osgeo.org/pipermail/grass-user/2012-March/064063.html
>
> and then v.to.db to upload exact x,y-coordinates in the attribute table
>
>
>
>
> -
> best regards
> Helmut
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979607.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>



-- 
David Montoya González
Ing. Forestal, Universidad Nacional de Colombia
Laboratorio de Sistemas Complejos, UNAL Medellin
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Margherita Di Leo
David,

On Thu, Jun 7, 2012 at 5:31 PM, David Montoya  wrote:

> Hi, I run the example of r.basin and I get this message at the end:
>
> Traceback (most recent call last):
>   File "/home/admin-lsc/Grass/Modulos/r.basin.py", line 427, in 
> sys.exit(main())
>   File "/home/admin-lsc/Grass/Modulos/r.basin.py", line 235, in main
> mainchannel = float(dict_mainchannel['Length']) / 1000
> KeyError: 'Length'
>
>
> Which example do you refer to (exact commands and dataset)? and when did
you download r.basin? On which OS and grass version?

Regards,
madi

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-07 Thread Rich Shepard

On Thu, 7 Jun 2012, Helmut Kudrnovsky wrote:


sure, it's taken from http://www.surfaces.co.il/?p=241


  Micha wrote an excellent description that answered a number of questions
for me. Now I'm ready to try r.basin again and want to check the validity of
my understanding of how I got where I now am and where it's going with
r.basin.

  The input to r.stream.extract came from r.watershed with this command:

r.watershed elev=dem_10m acc=facc drain=fdir basin=catch stream=str thresh=5

and was followed by r.stream.extract:

r.stream.extract elev=dem_10m acc=facc thresh=1000 stream_rast=rstream 
stream_vect=vstream

  To find the sub-basin outlets,

v.patch in=catchments,vstream out=basin_stream

and

v.clean in=basin_vstream out=basin_vstream_clean tool=break error=cross_points

  Prior to running v.out.ascii to save the cross_points in a text file I
carefully manually deleted extraneious tiny sub-basins and cross_points at
the confluences of stream channels. This reveals that many cross_points are
not on sub-basin boundaries generated by r.watershed.

  In Micha's blog article the cross_points.txt file is used as input to
r.water.outlet which generates the appropriate catchments. I assume this is
also true for r.basin; i.e., it will generate its own basins and sub-basins
based on the outlet points in the cross_points.txt file. Is this assumption
correct?

  My thanks to Markus(M), Madi, Helmut, and Micha.

Rich

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-08 Thread Helmut Kudrnovsky
>I think you had a typo between the names crosspoints and crosspointscat in
one line. I took the liberty of >fixing, and changing a few other layer
names for readability. If you could have a look to be sure it still reads
>correctly?

thanks for clarification

-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/r-basin-Completes-on-Some-Basins-Fails-on-Others-tp4979599p4979916.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-08 Thread Margherita Di Leo
Hi,

On Fri, Jun 8, 2012 at 1:44 AM, Rich Shepard wrote:

>
>
>  In Micha's blog article the cross_points.txt file is used as input to
> r.water.outlet which generates the appropriate catchments. I assume this is
> also true for r.basin; i.e., it will generate its own basins and sub-basins
> based on the outlet points in the cross_points.txt file. Is this assumption
> correct?
>
>
Correct. I've updated the wiki page
http://grass.osgeo.org/wiki/R.basin#Preparation_for_multiple_basins.27_analysis
Rich, if you'll test this method, I would appreciate your feedback. Feel
free to improve the wiki page (and to put it into real english :P )

ciao madi

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-08 Thread David Montoya
I did the example suggested on the wiki page, the same maps and the same
commands. I'm using Grass 6.4.2svn under Ubuntu, I'm going to update the
addons because I downloaded them one year ago

On Thu, Jun 7, 2012 at 11:15 AM, Margherita Di Leo wrote:

> David,
>
> On Thu, Jun 7, 2012 at 5:31 PM, David Montoya  wrote:
>
>> Hi, I run the example of r.basin and I get this message at the end:
>>
>> Traceback (most recent call last):
>>   File "/home/admin-lsc/Grass/Modulos/r.basin.py", line 427, in 
>> sys.exit(main())
>>   File "/home/admin-lsc/Grass/Modulos/r.basin.py", line 235, in main
>> mainchannel = float(dict_mainchannel['Length']) / 1000
>> KeyError: 'Length'
>>
>>
>> Which example do you refer to (exact commands and dataset)? and when did
> you download r.basin? On which OS and grass version?
>
> Regards,
>
> madi
>
> --
> Dr. Margherita Di Leo
>



-- 
David Montoya González
Ing. Forestal, Universidad Nacional de Colombia
Laboratorio de Sistemas Complejos, UNAL Medellin
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-08 Thread Margherita Di Leo
David,

On Fri, Jun 8, 2012 at 4:09 PM, David Montoya  wrote:

> I did the example suggested on the wiki page, the same maps and the same
> commands. I'm using Grass 6.4.2svn under Ubuntu, I'm going to update the
> addons because I downloaded them one year ago


yes this could be the problem, something has been updated in the code.
Please update r.basin and all the add-ons it is based on, and report any
problem. Thanks,

madi



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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-08 Thread Micha Silver

  
  
On 08/06/2012 12:13, Margherita Di Leo wrote:
  Hi,

On Fri, Jun 8, 2012 at 1:44 AM, Rich
  Shepard 
  wrote:
  


 In Micha's blog article the cross_points.txt file is used
as input to
r.water.outlet which generates the appropriate catchments. I
assume this is
also true for r.basin; i.e., it will generate its own basins
and sub-basins
based on the outlet points in the cross_points.txt file. Is
this assumption
correct?
 
  
  Correct. I've updated the wiki page http://grass.osgeo.org/wiki/R.basin#Preparation_for_multiple_basins.27_analysis
Rich, if you'll test this method, I would appreciate your
feedback. Feel free to improve the wiki page (and to put it
into real english :P )
  

  



Hi Madi:
Regarding the threshold value in your auxilliary parsing.py
  script, do you think it might be better to calcuclate a suggested
  value from the size of the original DEM, rather than just put in
  some random 10,000 or so.
Obviously the user has to understand, and change the threshold to
  suit his needs, but if the script is going to contain some value,
  maybe it should be something "reasonable". I thought, for example
  to choose a suggested thresh size of num_cells/100. i.e.:
N=`r.univar -g | grep "^n=" | cut -d "=" -f 2`
THRESH=$(( $N / 100))
Does that sound reasonable? Since the python auxilliary script
  runs independently of GRASS, I'm not sure how how this would all
  merge together. But it's worth thinking about.
Regards,
Micha


  

  ciao madi
  


-- 
Dr. Margherita Di Leo

This mail was received via Mail-SeCure System.



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

This mail was received via Mail-SeCure System.



  
  
  

  

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-08 Thread Rich Shepard

On Thu, 7 Jun 2012, Margherita Di Leo wrote:


you mean something like (untested):

#!/usr/bin/env python

fin = open("crosspoints","r")
fout = open("commands","w")
linesout = (line.rstrip().split() for line in fin)
cmd = 'r.basin map=dem prefix=bas%s easting=%s northing=%s
threshold=1\n'
fout.writelines(cmd % (n, easting, northing) for n,(easting,northing) in
enumerate(linesout))


  Works great!

  I turned the commands file to a bash script and it's now happily filling
up the directory with all the output files from 45 basins. Time to have
breakfast while it runs.

Many thanks,

Rich

--
Richard B. Shepard, Ph.D.  |   Integrity - Credibility - Innovation
Applied Ecosystem Services, Inc.   |Helping Ensure Our Clients' Futures
 Voice: 503-667-4517  Fax: 503-667-8863

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


Re: [GRASS-user] r.basin: Completes on Some Basins, Fails on Others

2012-06-08 Thread Margherita Di Leo
Hi Micha,

On Fri, Jun 8, 2012 at 4:48 PM, Micha Silver  wrote:

>
> Hi Madi:
>
> Regarding the threshold value in your auxilliary parsing.py script, do you
> think it might be better to calcuclate a suggested value from the size of
> the original DEM, rather than just put in some random 10,000 or so.
>
> Obviously the user has to understand, and change the threshold to suit his
> needs, but if the script is going to contain some value, maybe it should be
> something "reasonable". I thought, for example to choose a suggested thresh
> size of num_cells/100. i.e.:
>
> N=`r.univar -g | grep "^n=" | cut -d "=" -f 2`
>
> THRESH=$(( $N / 100))
>
> Does that sound reasonable? Since the python auxilliary script runs
> independently of GRASS, I'm not sure how how this would all merge together.
> But it's worth thinking about.
>
I've added comments in the wiki page in the python script section, about
the threshold and the name of the DEM, both parameters should be changed
manually.
For what concerns a "reasonable" value of the threshold, well, it actually
depends on too many factors, by the way, I've provided already some ways to
start from a "reasonable" value (all exposed in the wiki page):
1) r.basin has a flag -a which uses a default value of threshold,
corresponding to 1 km^2 (this value comes from literature and it's suitable
for _italian_ territory, this means that it could be completely wrong for
other territories)
2) r.threshold has a different reasoning. It starts from a relationship
between the slope and the upslope area.
3) r.stream.preview: it simply allow user to have a preview of the
threshold in order to quickly set a "reasonable" value. (this is a piece of
wx.stream, which I'm not satisfied of and am re-writing from scratch).
Anyway, if you think that the wiki page looks confusing, I really
appreciate your help in editing :-)

Thanks,

madi


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


Re: [GRASS-user] r.basin does not complete properly on one stream

2012-10-26 Thread Margherita Di Leo
Hi Rich,

unfortunately I don't have enough information in order to help you, would
it be possible to provide a sample data?

thanks and regards,
madi

On Fri, Oct 26, 2012 at 1:40 AM, Rich Shepard wrote:

>   For a reason I've not been able to determine in a long day today r.basin
> fails to properly complete when passed easting/northing coordinates of a
> cell generated by r.stream.extract. The last three ratios are shown as NAN
> and the area is shown as only 4km^2 when it's actually much larger. With
> other sub-basins this result was corrected by moving the outlet point
> further upstream from the confluence with a larger stream.
>
>   Following the r.basin wiki that madi wrote, I re-extracted the streams
> from the DEM. Ran r.watershed to generate an accumulation map, then
> r.stream.extract. Both modules take the same DEM map (named dem_proj). But,
> when I place the outlet point several cells above the confluence r.basin
> does not properly complete. I tried moving the outlet away from the
> confluence, but still no joy.
>
>   The attached PDF shows the outlet point sitting in the middle of a cell
> on
> the stream_network raster generated by r.stream.extract.
>
>   I'm at a loss to understand why this one sub-basin is fighting me, and I
> would like outside opinions on what might be the cause and suggestions of
> what to try to isolate the cause of this problem. If more information is
> desired, I'll try to provide it.
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>


-- 
Margherita DI LEO
Postdoctoral Researcher
European Commission - DG JRC
Forest Resources and Climate
I-21020 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-...@jrc.ec.europa.eu
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.basin does not complete properly on one stream [RESOLVED]

2012-11-01 Thread Rich Shepard

On Thu, 25 Oct 2012, Rich Shepard wrote:


 For a reason I've not been able to determine in a long day today r.basin
fails to properly complete when passed easting/northing coordinates of a
cell generated by r.stream.extract. The last three ratios are shown as NAN
and the area is shown as only 4km^2 when it's actually much larger. With
other sub-basins this result was corrected by moving the outlet point
further upstream from the confluence with a larger stream.


  For 5 of 7 sub-basins applying a threshold of 7500 to r.basin worked fine.
For the other two, adjacent with nearby outlets, the threshold needs to be
reduced to 2500 to have r.basin run to completion and produce two separate
basins without overlap.

  Problem resolved.

Rich

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