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 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

[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