I built a composite DEM of Florida using USGS NED 1 30m DEM tiles. I used r.patch to convert the individual tiles into a single raster and then projected it into a new region with the EPSG:26958 Florida/E CRS and set the resolution to 100.

I then ran the r.basin command as follows:

g.region raster=dem_all_reproj -pa    
r.basin map=dem_all_reproj prefix=my_basin coord=-103242.32,681661.75 
dir=/tmp/bla threshold=1000 --overwrite

Everything went well but then an error occurs with a resolution conflict for the strahler map. The last few lines of console output including the error are:

Building topology for vector map 
Registering primitives...
3 primitives registered
83 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 6
Number of primitives: 3
Number of points: 0
Number of lines: 3
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
r.to.vect complete.
All in RAM calculation...
ERROR: Region resolution and raster map <my_basin_dem_all_reproj_strahler> 
resolution differs. Run 'g.region raster=my_basin_dem_all_reproj_strahler' 
to set proper region resolution.

An ERROR occurred running r.basin
Please check for error messages above or try with another pairs of outlet 
Removing region definition <original>
(Mon Jul 03 14:44:12 2017) Command finished (5 min 31 sec)     

The peculiar thing is the dem_all_reproj_strahler raster seems to get created. It's info is:

 | Map:      my_basin_dem_all_reproj_strah  Date: Mon Jul 03 14:43:14 2017    |
 | Mapset:   Florida26958                   Login of Creator: davidleedal     |
 | Location: FloridaDelineation                                               |
 | DataBase: C:\Users\davidleedal\Documents\GrassDatabase                     |
 | Title:                                                                     |
 | Timestamp: none                                                            |
 |                                                                            |
 |   Type of Map:  raster               Number of Categories: 0               |
 |   Data Type:    CELL                                                       |
 |   Rows:         9068                                                       |
 |   Columns:      7374                                                       |
 |   Total Cells:  66867432                                                   |
 |        Projection: unnamed                                                 |
 |            N: 869573.63042789    S: -37202.49012235   Res: 99.99736662     |
 |            E: 302179.0942108    W:    -435223   Res: 100.000284            |
 |   Range of data:    min = 1  max = 2                                       |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by r.stream.order                                             |
 |                                                                            |
 |   Comments:                                                                |
 |    r.stream.order stream_rast="my_basin_dem_all_reproj_stream_e" direct\   |
 |    ion="my_basin_dem_all_reproj_drainage_e" strahler="my_basin_dem_all_\   |
 |    reproj_strahler" horton="my_basin_dem_all_reproj_horton" shreve="my_\   |
 |    basin_dem_all_reproj_shreve" hack="my_basin_dem_all_reproj_hack" mem\   |
 |    ory=300                                                                 |
 |                                                                            |

...which is the same resolution as the region. I've tried a few changes, such as reprojecting the whole region at a different resolution but r.basin alsways stops at the same point. Can anyone identify the problem?

I'm using GRASS 7.2.1 in Windows 7 from QGIS 7.18 package download (but I'm not running GRASS from within QGIS).

  • I am experiencing the same issue, resolutions in the created Strahler file seem to be exactly the same as the DEM that r.basin is working on. (Sorry, this is not an "Answer" but I don't yet have enough "reputation points" to merely comment). – B. Mullen Nov 24 '17 at 13:19

I was able to get r.basin to run to completion today. My project originally began in QGIS with a DEM in units of feet. Since GRASS's r.basin only uses metric units I used QGIS to convert DEM elevations using the raster calculator and horizontal units by reprojecting into a CRS with metric units. After importing the converted DEM into GRASS and running r.basin I experienced the exact same issue as you. While debugging, I checked the raster's basic metadata and noticed that something didn't make sense with resolution and number of cells, i.e. the N-S and E-W distances didn't make sense! Something apparently went wrong during my conversion of horizontal units from feet to meters within QGIS. I solved the problem by re-downloading the DEM from NOAA's Data Access Viewer site directly into metric units (both horiz and vert) and successfully reran r.basin in GRASS to completion. Hope this helps you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.