[GRASS-user] Problem with r.basin in grass7

Hi Helmut,

Thanks for your email.
I set again the area and resolution with g.region before running r.basin. I also deleted all files except my DEM.

Now I get a different error …

When I run

r.basin map=map@Elevation prefix=o coordinates=-71.10394196,43.9865230801 threshold=19005 dir=C:\Users\Andrea\Basins

I get:
“…
Building topology for vector map o_map_ord_1@Elevation
Registering primitives…
10 primitives registered
558 vertices registered
Building areas…
0 areas built
0 isles built
Attaching islands…
Attaching centroids…
Number of nodes: 20
Number of primitives: 10
Number of points: 0
Number of lines: 10
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Updating attributes…
r.to.vect complete.
All in RAM calculation…
ERROR: Region resolution and raster map <o_map_strahler> resolution differs. Run ‘g.region rast=o_map_strahler’ to set proper region resolution

I run g.region rast=o_map_strahler, but then I have to delete all files and start over again running r.basin.

I tried using a different computational resolutions in g.region, but got the same error.

Thanks,
Andrea.

Gesendet: Sonntag, 16. November 2014 um 13:22 Uhr
Von: “Helmut Kudrnovsky” hellik@web.de
An: grass-user@lists.osgeo.org
Betreff: Re: [GRASS-user] Problem with r.basin in grass7
Andrea Timmermann wrote

Hi !!

 

Thanks for the update. 

I reinstalled the latest grass  (version 13.11) and could also
install all the r.stream addons without problems.

 

There is still a problem with r.basin, however.

When I run:

"r.basin map=map@Elevation prefix=o
coordinates=-71.10394196,43.9865230801 threshold=19005
dir=C:\\Users\\Andrea\\Basins"

 

I get:

"…

Width Function | quantiles

===========================
9291 | 0.05
15726 | 0.15
27145 | 0.3
31933 | 0.4
35026 | 0.5
38212 | 0.6
41192 | 0.7
49125 | 0.85
56807 | 0.95
Done!

All in RAM calculation - method <DOWNSTREAM>…
Reading raster map <o_map_stream_e>…
Reading raster map <o_map_drainage>…
Finding nodes…
Reading raster map <r_elevation_crop>…
Calculate downstream parameters…
Writing raster map <o_map_hillslope_distance>…
First pass
Writing output map
r.stats.zonal done
r.info done
r.mapcalc done
ERROR: Reading raster map <o_map_basin@> request for row -130 is
outside region


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

tested r.basin here on my side:

r.basin --verbose map=dem_linked@PERMANENT prefix=a
coordinates=-51121.42352,193901.704819 dir=C:\tmp\rstreamtest
threshold=12000
[…]
(Sun Nov 16 13:12:48 2014) Befehl ausgeführt (40 Min 25 Sek)

r.basin finishes here.

please try to reset and align your region to the DEM before a r.basin-run.


best regards
Helmut

View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5173189.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

Hi Andrea,

···

On Tue, Nov 18, 2014 at 3:55 AM, Andrea Timmermann <timmermann@gmx.at> wrote:

Hi Helmut,

Thanks for your email.
I set again the area and resolution with g.region before running r.basin. I also deleted all files except my DEM.

Now I get a different error …

When I run

r.basin map=map@Elevation prefix=o coordinates=-71.10394196,43.9865230801 threshold=19005 dir=C:\Users\Andrea\Basins

I get:
"…

Building topology for vector map o_map_ord_1@Elevation
Registering primitives…
10 primitives registered
558 vertices registered
Building areas…
0 areas built
0 isles built
Attaching islands…
Attaching centroids…
Number of nodes: 20
Number of primitives: 10
Number of points: 0
Number of lines: 10
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Updating attributes…
r.to.vect complete.
All in RAM calculation…
ERROR: Region resolution and raster map <o_map_strahler> resolution differs. Run ‘g.region rast=o_map_strahler’ to set proper region resolution"

I run g.region rast=o_map_strahler, but then I have to delete all files and start over again running r.basin.

Yes if you change the region you have to delete the files created in the previous run (if they have same name) or allow overwrite.

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-leo@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.

Hi Margherita,

Thanks for your answer. I am sorry I did not explain well what I meant.

When I delete all files and start again, I get again stuck at that point.

What I do is: delete all files, set region, run r.basin, get the error … detele all files, set the region, run r.basin, get the error …

I just tried it again …

Thanks,
Andrea

···

On Tue, Nov 18, 2014 at 3:55 AM, Andrea Timmermann timmermann@gmx.at wrote:

Hi Helmut,

Thanks for your email.
I set again the area and resolution with g.region before running r.basin. I also deleted all files except my DEM.

Now I get a different error …

When I run

r.basin map=map@Elevation prefix=o coordinates=-71.10394196,43.9865230801 threshold=19005 dir=C:\Users\Andrea\Basins

I get:
“…
Building topology for vector map o_map_ord_1@Elevation
Registering primitives…
10 primitives registered
558 vertices registered
Building areas…
0 areas built
0 isles built
Attaching islands…
Attaching centroids…
Number of nodes: 20
Number of primitives: 10
Number of points: 0
Number of lines: 10
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Updating attributes…
r.to.vect complete.
All in RAM calculation…
ERROR: Region resolution and raster map <o_map_strahler> resolution differs. Run ‘g.region rast=o_map_strahler’ to set proper region resolution

I run g.region rast=o_map_strahler, but then I have to delete all files and start over again running r.basin.

Yes if you change the region you have to delete the files created in the previous run (if they have same name) or allow overwrite.

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-leo@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.

Hi Andrea,

···

On Tue, Nov 18, 2014 at 4:06 PM, Andrea Timmermann <timmermann@gmx.at> wrote:

Hi Margherita,

Thanks for your answer. I am sorry I did not explain well what I meant.

When I delete all files and start again, I get again stuck at that point.

What I do is: delete all files, set region, run r.basin, get the error … detele all files, set the region, run r.basin, get the error …

I just tried it again …

Can you please post the result of:
r.info map@Elevation
and

g.region -p

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-leo@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.

Andrea Timmermann wrote

Hi Margherita,&nbsp;

&nbsp;

Thanks for your answer. I am sorry I did not explain well what I
meant.&nbsp;

&nbsp;

When I delete all files and start again, I get again stuck at that point.

&nbsp;

What I do is: delete all files, set region, run r.basin, get the error ...
detele all files, set the region, run r.basin, get the error ....
&nbsp;&nbsp;

&nbsp;

I just tried it again ..

&nbsp;

Thanks,&nbsp;

Andrea

Gesendet:&nbsp;Dienstag, 18. November 2014 um 09:38 Uhr
Von:&nbsp;&quot;Margherita Di Leo&quot; &lt;

diregola@

&gt;
An:&nbsp;&quot;Andrea Timmermann&quot; &lt;

timmermann@

&gt;
Cc:&nbsp;&quot;Helmut Kudrnovsky&quot; &lt;

hellik@

&gt;, &quot;GRASS user list&quot; &lt;

grass-user@.osgeo

&gt;
Betreff:&nbsp;Re: [GRASS-user] Problem with r.basin in grass7

Hi Andrea,
&nbsp;
On Tue, Nov 18, 2014 at 3:55 AM, Andrea Timmermann &lt;

timmermann@

&gt; wrote:

Hi Helmut,&nbsp;

&nbsp;

Thanks for your email.&nbsp;

I set again the area and resolution with g.region before running r.basin.
I also deleted all files except my DEM.&nbsp;

&nbsp;

Now I get a different error ...

&nbsp;

When I run

&quot;r.basin map=map@Elevation prefix=o
coordinates=-71.10394196,43.9865230801 threshold=19005
dir=C:&#92;&#92;Users&#92;&#92;Andrea&#92;&#92;Basins&quot;

&nbsp;

I get:

&quot;...

Building topology for vector map &lt;o_map_ord_1@Elevation&gt;...
Registering primitives...
10 primitives registered
558 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 20
Number of primitives: 10
Number of points: 0
Number of lines: 10
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Updating attributes...
r.to.vect complete.
All in RAM calculation...
ERROR: Region resolution and raster map &lt;o_map_strahler&gt; resolution
differs. Run &#39;g.region rast=o_map_strahler&#39; to set proper region
resolution&quot;

&nbsp;

I run&nbsp;g.region rast=o_map_strahler,&nbsp;but then I have to delete
all files and start over again running r.basin.

&nbsp;

Yes if you change the region you have to delete the files created in the
previous run (if they have same name) or allow overwrite.

&nbsp;
--

Best regards,

&nbsp;

Dr. Margherita DI LEO &nbsp; &nbsp;

Scientific / technical project officer

&nbsp;

European Commission - DG JRC&nbsp;

Institute for Environment and Sustainability (IES)

Via Fermi, 2749

I-21027 Ispra (VA) - Italy - TP 261

&nbsp; &nbsp; &nbsp; &nbsp;

Tel. +39 0332 78 3600 &nbsp;&nbsp;

margherita.di-leo@.europa

&nbsp;

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@.osgeo

http://lists.osgeo.org/mailman/listinfo/grass-user

  can you test it with the nc sample dataset?

otherwise could you point to the DEM you're using or make the dataset
available?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5173574.html
Sent from the Grass - Users mailing list archive at Nabble.com.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5173586.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Andrea Timmermann wrote

Hi Margherita,&nbsp;

&nbsp;

Thanks for your answer. I am sorry I did not explain well what I
meant.&nbsp;

&nbsp;

When I delete all files and start again, I get again stuck at that point.

&nbsp;

What I do is: delete all files, set region, run r.basin, get the error ...
detele all files, set the region, run r.basin, get the error ....
&nbsp;&nbsp;

&nbsp;

I just tried it again ..

&nbsp;

Thanks,&nbsp;

Andrea

Gesendet:&nbsp;Dienstag, 18. November 2014 um 09:38 Uhr
Von:&nbsp;&quot;Margherita Di Leo&quot; &lt;

diregola@

&gt;
An:&nbsp;&quot;Andrea Timmermann&quot; &lt;

timmermann@

&gt;
Cc:&nbsp;&quot;Helmut Kudrnovsky&quot; &lt;

hellik@

&gt;, &quot;GRASS user list&quot; &lt;

grass-user@.osgeo

&gt;
Betreff:&nbsp;Re: [GRASS-user] Problem with r.basin in grass7

Hi Andrea,
&nbsp;
On Tue, Nov 18, 2014 at 3:55 AM, Andrea Timmermann &lt;

timmermann@

&gt; wrote:

Hi Helmut,&nbsp;

&nbsp;

Thanks for your email.&nbsp;

I set again the area and resolution with g.region before running r.basin.
I also deleted all files except my DEM.&nbsp;

&nbsp;

Now I get a different error ...

&nbsp;

When I run

&quot;r.basin map=map@Elevation prefix=o
coordinates=-71.10394196,43.9865230801 threshold=19005
dir=C:&#92;&#92;Users&#92;&#92;Andrea&#92;&#92;Basins&quot;

&nbsp;

I get:

&quot;...

Building topology for vector map &lt;o_map_ord_1@Elevation&gt;...
Registering primitives...
10 primitives registered
558 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 20
Number of primitives: 10
Number of points: 0
Number of lines: 10
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Updating attributes...
r.to.vect complete.
All in RAM calculation...
ERROR: Region resolution and raster map &lt;o_map_strahler&gt; resolution
differs. Run &#39;g.region rast=o_map_strahler&#39; to set proper region
resolution&quot;

&nbsp;

I run&nbsp;g.region rast=o_map_strahler,&nbsp;but then I have to delete
all files and start over again running r.basin.

&nbsp;

Yes if you change the region you have to delete the files created in the
previous run (if they have same name) or allow overwrite.

&nbsp;
--

Best regards,

&nbsp;

Dr. Margherita DI LEO &nbsp; &nbsp;

Scientific / technical project officer

&nbsp;

European Commission - DG JRC&nbsp;

Institute for Environment and Sustainability (IES)

Via Fermi, 2749

I-21027 Ispra (VA) - Italy - TP 261

&nbsp; &nbsp; &nbsp; &nbsp;

Tel. +39 0332 78 3600 &nbsp;&nbsp;

margherita.di-leo@.europa

&nbsp;

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@.osgeo

http://lists.osgeo.org/mailman/listinfo/grass-user

could you post also the exact commands of your steps?
e.g.

g.region -a -p rast=yourdem align=yourdem
r.basin --verbose elevation=yourdem....

g.region

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5173590.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi Helmut and Margherita,

Thanks for your mails! Here are the answers to your questions:

a) This is the result of r.info and g.region:

r.info map@Elevation
±---------------------------------------------------------------------------+
| Map: map@Elevation Date: Sat Nov 15 16:35:08 2014 |
| Mapset: Elevation Login of Creator: Andrea |
| Location: ElevationData |
| DataBase: C:\Users\Andrea\Documents\grassdata |
| Title: ( map ) |

Timestamp: none
Type of Map: raster Number of Categories: 0
Data Type: FCELL
Rows: 21612
Columns: 10812
Total Cells: 233668944
Projection: Latitude-Longitude
N: 45:00:02N S: 42:59:58N Res: 0:00:00.333333
E: 70:59:58W W: 72:00:02W Res: 0:00:00.333333
Range of data: min = 18.40538 max = 1916.398
Data Description:
generated by r.patch
Comments:
r.patch input=“n44-72@Elevation,n45_72@Elevation” output=“map”
±---------------------------------------------------------------------------+

g.region -p
projection: 3 (Latitude-Longitude)
zone: 0
datum: nad83
ellipsoid: grs80
north: 45:00:02N
south: 42:59:58N
west: 72:00:02W
east: 70:59:58W
nsres: 0:00:01
ewres: 0:00:01
rows: 7204
cols: 3604
cells: 25963216

b) These are all my steps:
++ open grass
++ load my two raster files
++ r.patch --overwrite input=n44_72@Elevation,n45_72@Elevation output=map
++ g.remove -f type=all name=original@Elevation,o_map_accumulation@Elevation,o_map_aspect@Elevation,o_map_aspect_mod@Elevation,o_map_average_hillslope@Elevation,o_map_basin@Elevation,o_map_dist2out@Elevation,o_map_drainage@Elevation,o_map_drainage_e@Elevation,o_map_hack@Elevation,o_map_height_average@Elevation,o_map_hillslope_distance@Elevation,o_map_horton@Elevation,o_map_mainchannel@Elevation,o_map_mainchannel_dim@Elevation,o_map_mainchannel_thin@Elevation,o_map_mask@Elevation,o_map_ord_1@Elevation,o_map_ord_1_thin@Elevation,o_map_r_outlet@Elevation,o_map_shreve@Elevation,o_map_slope@Elevation,o_map_strahler@Elevation,o_map_stream_e@Elevation,o_map_stream_e_thin@Elevation,r_elevation_crop@Elevation,o_map_basin@Elevation,o_map_mainchannel@Elevation,o_map_mainchannel_dim@Elevation,o_map_mainchannel_dim_point@Elevation,o_map_network@Elevation,o_map_ord_1@Elevation,o_map_outlet@Elevation,o_map_outlet_snap@Elevation,o_map_mainchannel_dim_thin@Elevation

++ g.region rast=map@Elevation res=0:00:01
(also tried with g.region -a rast=map@Elevation res=0:00:01, and got the same result)

++ r.basin map=map@Elevation prefix=o coordinates=-71.10394196,43.9865230801 threshold=19005 dir=“C:\Users\Andrea\Basins5”

c) Try to use the NC dataset
I downloaded it, but did not any changes in the resolution and computational region, since the manual said that the maps were ready for use…
I chose some coordinates just by a visual inspection of the DEM and used just random threshold. I run:

r.basin map=elev_ned_30m@PERMANENT prefix=o coordinates=640856.761198,215050.690725 threshold=400 dir="C:\Users\Andrea\Basins6

and get:


Tot. cells 543.0
===========================
Hypsometric | quantiles
===========================
106 | 0.025
105 | 0.05
103 | 0.1
100 | 0.25
95 | 0.5
87 | 0.75
89 | 0.7
81 | 0.9
76 | 0.975
Done!
------------------------------
------------------------------
Traceback (most recent call last):
File "C:\Users\Andrea\AppData\Roaming\GRASS7\addons/scri
pts/r.width.funct.py", line 130, in
sys.exit(main())
File "C:\Users\Andrea\AppData\Roaming\GRASS7\addons/scri
pts/r.width.funct.py", line 86, in main
prc[4,0] , prc[4,1] = findint(kl,0.5) , 0.5
File "C:\Users\Andrea\AppData\Roaming\GRASS7\addons/scri
pts/r.width.funct.py", line 123, in findint
z1 , z2 , f1 , f2 = kl[float(Xf[0])][0] ,
kl[float(Xf[0]-1)][0] , kl[float(Xf[0])][1] ,
kl[float(Xf[0]-1)][1]
TypeError: only length-1 arrays can be converted to Python
scalars
Tot. cells 543.0
Tot. area 441051.75
Max distance 1693.190486

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

d) Results of r.info and g.region for the NC dataset

r.info elev_ned_30m@PERMANENT
±---------------------------------------------------------------------------+
| Map: elev_ned_30m@PERMANENT Date: Tue Nov 7 00:35:18 2006 |
| Mapset: PERMANENT Login of Creator: helena |
| Location: nc_spm_08_grass7 |
| DataBase: C:\Users\Andrea\Documents\grassdata\nc_spm_08_grass7 |
| Title: South-West Wake county: National Elevation Data 30m ( elev_ned30 |

Timestamp: none
Type of Map: raster Number of Categories: 255
Data Type: FCELL
Rows: 450
Columns: 500
Total Cells: 225000
Projection: Lambert Conformal Conic
N: 228500 S: 215000 Res: 30
E: 645000 W: 630000 Res: 30
Range of data: min = 55.1736 max = 156.3865
Data Description:
generated by r.proj
Comments:
r.proj input=“ned1arcsec” location=“northcarolina_latlong” mapset="h\
elena" output=“elev_ned30m” method=“cubic” resolution=30
±---------------------------------------------------------------------------+

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

e) The DEMs I am using
They are from the NED webpage (USGS), here is the link they sent me for downloading their files, but they are kind of large. If you want to download them I could select a catchment which only uses one DEM …

https://3c.gmx.net/mail/client/dereferrer?redirectUrl=ftp%3A%2F%2Frockyftp.cr.usgs.gov%2Fvdelivery%2FDatasets%2FStaged%2FNED%2F13%2FArcGrid%2Fn45w072.zip

https://3c.gmx.net/mail/client/dereferrer?redirectUrl=ftp%3A%2F%2Frockyftp.cr.usgs.gov%2Fvdelivery%2FDatasets%2FStaged%2FNED%2F13%2FArcGrid%2Fn44w072.zip

Hope this helps,
Regards, Andrea.

Gesendet: Dienstag, 18. November 2014 um 16:54 Uhr
Von: “Helmut Kudrnovsky” hellik@web.de
An: grass-user@lists.osgeo.org
Betreff: Re: [GRASS-user] Problem with r.basin in grass7
Andrea Timmermann wrote

Hi Margherita, 

 

Thanks for your answer. I am sorry I did not explain well what I
meant. 

 

When I delete all files and start again, I get again stuck at that point.

 

What I do is: delete all files, set region, run r.basin, get the error …
detele all files, set the region, run r.basin, get the error …
  

 

I just tried it again ..

 

Thanks, 

Andrea

Gesendet: Dienstag, 18. November 2014 um 09:38 Uhr
Von: "Margherita Di Leo" <

diregola@

>
An: "Andrea Timmermann" <

timmermann@

>
Cc: "Helmut Kudrnovsky" <

hellik@

>, "GRASS user list" <

grass-user@.osgeo

>
Betreff: Re: [GRASS-user] Problem with r.basin in grass7

Hi Andrea,
 
On Tue, Nov 18, 2014 at 3:55 AM, Andrea Timmermann <

timmermann@

> wrote:

Hi Helmut, 

 

Thanks for your email. 

I set again the area and resolution with g.region before running r.basin.
I also deleted all files except my DEM. 

 

Now I get a different error …

 

When I run

"r.basin map=map@Elevation prefix=o
coordinates=-71.10394196,43.9865230801 threshold=19005
dir=C:\\Users\\Andrea\\Basins"

 

I get:

"…

Building topology for vector map <o_map_ord_1@Elevation>…
Registering primitives…
10 primitives registered
558 vertices registered
Building areas…
0 areas built
0 isles built
Attaching islands…
Attaching centroids…
Number of nodes: 20
Number of primitives: 10
Number of points: 0
Number of lines: 10
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Updating attributes…
r.to.vect complete.
All in RAM calculation…
ERROR: Region resolution and raster map <o_map_strahler> resolution
differs. Run 'g.region rast=o_map_strahler' to set proper region
resolution"

 

I run g.region rast=o_map_strahler, but then I have to delete
all files and start over again running r.basin.

 

Yes if you change the region you have to delete the files created in the
previous run (if they have same name) or allow overwrite.

 

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-leo@.europa

 

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@.osgeo

http://lists.osgeo.org/mailman/listinfo/grass-user

could you post also the exact commands of your steps?
e.g.

g.region -a -p rast=yourdem align=yourdem
r.basin --verbose elevation=yourdem…

g.region


best regards
Helmut

View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5173590.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

"These various resolutions, referred to as NED layers, are stored and
distributed in geographic coordinates at 1/9, 1/3, 1, and 2 seconds of arc."

for several reasons r.basin works in projected locations, but not in
geographic locations. the NED seems to be geographic.

try to reproject your DEM data first into a projected location.

regarding the NC sample data set I'll have look later in the day, as in this
sample location it works for me.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5173943.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Dear Andrea,

···

On Thu, Nov 20, 2014 at 5:00 AM, Andrea Timmermann <timmermann@gmx.at> wrote:

Hi Helmut and Margherita,

Thanks for your mails! Here are the answers to your questions:

a) This is the result of r.info and g.region:

r.info map@Elevation
±---------------------------------------------------------------------------+
| Map: map@Elevation Date: Sat Nov 15 16:35:08 2014 |
| Mapset: Elevation Login of Creator: Andrea |
| Location: ElevationData |
| DataBase: C:\Users\Andrea\Documents\grassdata |
| Title: ( map ) |

Timestamp: none
Type of Map: raster Number of Categories: 0
Data Type: FCELL
Rows: 21612
Columns: 10812
Total Cells: 233668944
Projection: Latitude-Longitude
N: 45:00:02N S: 42:59:58N Res: 0:00:00.333333
E: 70:59:58W W: 72:00:02W Res: 0:00:00.333333
Range of data: min = 18.40538 max = 1916.398
Data Description:
generated by r.patch
Comments:
r.patch input=“n44-72@Elevation,n45_72@Elevation” output=“map”
±---------------------------------------------------------------------------+

g.region -p

projection: 3 (Latitude-Longitude)
zone: 0
datum: nad83
ellipsoid: grs80

north: 45:00:02N
south: 42:59:58N
west: 72:00:02W
east: 70:59:58W
nsres: 0:00:01
ewres: 0:00:01
rows: 7204
cols: 3604
cells: 25963216

Here I see 2 possible problems. One is the one referred by Helmut, that r.basin only is able to work on projected locations. The other is that the region should match with the dem, thus, before running r.basin, please set g.region rast=map@Elevation . The same applies also to your example in the NC dataset.

Let us know how it goes.

cheers,

madi

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-leo@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.

c) Try to use the NC dataset

now tested here with NC dataset (see also
http://grasswiki.osgeo.org/wiki/R.basin; the coordinates are taken from the
wiki)

r.info map=elevation@PERMANENT

+----------------------------------------------------------------------------+
| Map: elevation@PERMANENT Date: Tue Nov 7 01:09:51 2006
|
| Mapset: PERMANENT Login of Creator: helena
|
| Location: nc_spm_08_grass7
|
| DataBase: C:\grassdata
|
| Title: South-West Wake county: Elevation NED 10m ( elev_ned10m )
|
| Timestamp: none
|

|----------------------------------------------------------------------------|
|
|
| Type of Map: raster Number of Categories: 255
|
| Data Type: FCELL
|
| Rows: 1350
|
| Columns: 1500
|
| Total Cells: 2025000
|
| Projection: Lambert Conformal Conic
|
| N: 228500 S: 215000 Res: 10
|
| E: 645000 W: 630000 Res: 10
|
| Range of data: min = 55.57879 max = 156.3299
|
|
|
| Data Description:
|
| generated by r.proj
|
|
|
| Comments:
|
| r.proj input="ned03arcsec" location="northcarolina_latlong" mapset="\
|
| helena" output="elev_ned10m" method="cubic" resolution=10
|
|
|

+----------------------------------------------------------------------------+

then

g.region -p -a rast=elevation@PERMANENT align=elevation@PERMANENT
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 10
ewres: 10
rows: 1350
cols: 1500
cells: 2025000
(Thu Nov 20 11:29:22 2014) Befehl ausgeführt (4 Sek)

and

r.basin --verbose map=elevation@PERMANENT prefix=a
coordinates=636654.791181,218824.126649 dir=C:\tmp\rbasin threshold=40
[...]
(Thu Nov 20 11:40:48 2014) Befehl ausgeführt (7 Min 0 Sek)

r.basin finishes. as Margherita already mentioned, the region resolution has
to be aligned to the DEM resolution.

have a look at r.info map=elevation@PERMANENT :

| Comments:
|
| r.proj input="ned03arcsec" location="northcarolina_latlong" mapset="\
|
| helena" output="elev_ned10m" method="cubic" resolution=10

that can be a starting point for the reprojection of your NED DEM (in
geographic coordinates) to a projected location.

HTH

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5173992.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Thu, Nov 20, 2014 at 9:22 AM, Margherita Di Leo <diregola@gmail.com> wrote:

[...], that
r.basin only is able to work on projected locations.

In r62834, I have added to r.basin a check for unsupported locations.

Markus

Hi,

I just resumed my work with GRASS after some weeks of inactivity.
I downloaded the newest GRASS version and also updated my addons.
I am using the NC test data and get an error at the end when running r.basin.

When I run:

“r.basin map=elev_ned_30m@PERMANENT prefix=sss coordinates=636654.791181,218824.126649 threshold=40 dir=“C:\Users\Andrea\Basins2222” --overwrite”

I get:
"…

Reading raster map <sss_elev_ned_30m_strahler>…
Reading raster map <sss_elev_ned_30m_drainage_e>…
Reading raster map <r_elevation_crop>…
ERROR: Error while executing: ‘DROP TABLE summary’
Traceback (most recent call last):
File “C:\Program Files (x86)\GRASS GIS
7.1.svn/scripts/db.in.ogr.py”, line 123, in
main()
File “C:\Program Files (x86)\GRASS GIS
7.1.svn/scripts/db.in.ogr.py”, line 77, in main
grass.write_command(‘db.execute’, input = ‘-’, stdin =
“DROP TABLE %s” % output)
File “C:\Program Files (x86)\GRASS GIS
7.1.svn\etc\python\grass\script\core.py”, line 483, in
write_command
return handle_errors(returncode, returncode, args,
kwargs)
File “C:\Program Files (x86)\GRASS GIS
7.1.svn\etc\python\grass\script\core.py”, line 308, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
[‘db.execute’, ‘input=-’, ‘stdin=DROP TABLE summary’] ended
with error
Process ended with non-zero return code 1. See errors in the
(error) output.


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


Output of r.stream.stats:
Summary:
Max order | Tot.N.str. | Tot.str.len. | Tot.area. | Dr.dens. | Str.freq.
(num) | (num) | (km) | (km2) | (km/km2) | (num/km2)
4 | 47 | 26.4605 | 7.9101 | 3.3452 | 5.9418
Stream ratios based on regresion coefficient:
Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt.
3.2413 | 1.2265 | 3.5856 | 1.6621 | 1.7310
Avaraged stream ratios with standard deviations:
Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt.
4.6667 | 1.7001 | 4.1945 | 1.9270 | 2.0256
4.6188 | 1.2717 | 5.4587 | 0.8586 | 0.9290
Order | Avg.len | Avg.ar | Avg.sl | Avg.grad. | Avg.el.dif
num | (km) | (km2) | (m/m) | (m/m) | (m)
1 | 0.4573 | 0.1462 | 0.0328 | 0.0254 | 9.7057
2 | 1.3953 | 1.5154 | 0.0128 | 0.0106 | 13.4085
3 | 0.7346 | 3.3597 | 0.0134 | 0.0109 | 9.4618
4 | 1.1185 | 7.9101 | 0.0059 | 0.0040 | 4.5139
Order | Std.len | Std.ar | Std.sl | Std.grad. | Std.el.dif
num | (km) | (km2) | (m/m) | (m/m) | (m)
1 | 0.3874 | 0.1177 | 0.0207 | 0.0138 | 6.2704
2 | 2.1832 | 2.3181 | 0.0099 | 0.0091 | 16.5566
3 | 0.8267 | 3.0598 | 0.0009 | 0.0034 | 11.5751
4 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000
Order | N.streams | Tot.len (km) | Tot.area (km2)
1 | 40 | 18.2917 | 5.8473
2 | 4 | 5.5811 | 6.0615
3 | 2 | 1.4691 | 6.7194
4 | 1 | 1.1185 | 7.9101
Order | Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt. | d.dens. | str.freq.
1 | 10.0000 | 3.0512 | 0.0000 | 2.5727 | 2.3961 | 3.1282 | 6.8408
2 | 2.0000 | 0.5265 | 10.3663 | 0.9526 | 0.9685 | 0.9207 | 0.6599
3 | 2.0000 | 1.5227 | 2.2171 | 2.2558 | 2.7122 | 0.2186 | 0.2976
4 | 0.0000 | 0.0000 | 2.3544 | 0.0000 | 0.0000 | 0.1414 | 0.1264
(Sun Dec 14 17:12:49 2014) Command finished (40 sec)

Thanks,
Andrea.

Gesendet: Donnerstag, 20. November 2014 um 12:10 Uhr
Von: “Markus Neteler” neteler@osgeo.org
An: “Margherita Di Leo” diregola@gmail.com
Cc: “Andrea Timmermann” timmermann@gmx.at, “GRASS user list” grass-user@lists.osgeo.org, “Helmut Kudrnovsky” hellik@web.de
Betreff: Re: [GRASS-user] Problem with r.basin in grass7
On Thu, Nov 20, 2014 at 9:22 AM, Margherita Di Leo diregola@gmail.com wrote:

[…], that
r.basin only is able to work on projected locations.

In r62834, I have added to r.basin a check for unsupported locations.

Markus

hi Andrea,

I set again the area and resolution with g.region before running r.basin. I

also deleted all files except my >DEM.

Now I get a different error ...

When I run
"r.basin map=map@Elevation prefix=o coordinates=-71.10394196,43.9865230801

threshold=19005 >dir=C:\\Users\\Andrea\\Basins"

ERROR: Region resolution and raster map <o_map_strahler> resolution

differs. Run 'g.region >rast=o_map_strahler' to set proper region
resolution"

please test r.basin with the NC data sample data for GRASS: GRASS 7 full
data tar.gz | zip (nc_spm, 145MB)
(http://grass.osgeo.org/download/sample-data/)

and have a look at http://grasswiki.osgeo.org/wiki/R.basin#Usage for a
r.basin usage with this NC sample data (the wiki needs some update, feel
free to contribute...)

tested here with NC data sample data (with coordinates taken from the wiki),
it works without any error.

please try following commands (just copy/paste it and adapt only the path to
the output directory) within the NC sample data set:

g.region -p -a raster=elevation@PERMANENT align=elevation@PERMANENT

r.basin map=elevation@PERMANENT prefix=a
coordinates=636654.791181,218824.126649 dir=C:\tmp\rbasin threshold=20

and then report back.

[p.s. could you send text emails to the ML instead of hmtl mails? it's more
readable in the ML archive]

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5177835.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi Helmut,

I downloaded the newest GRASS version and also updated my addons.
I am using the newest version of the NC test data set.

My result of g.region -p is:
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

When I run:
"r.basin map=elev_ned_30m@PERMANENT prefix=sss coordinates=636654.791181,218824.126649 threshold=40 dir="C:\\Users\\Andrea\\Basins2222" --overwrite"

I get:
"....
....
Reading raster map <sss_elev_ned_30m_strahler>...
Reading raster map <sss_elev_ned_30m_drainage_e>...
Reading raster map <r_elevation_crop>...
ERROR: Error while executing: 'DROP TABLE summary'
Traceback (most recent call last):
  File "C:\Program Files (x86)\GRASS GIS
7.1.svn/scripts/db.in.ogr.py", line 123, in <module>
    main()
  File "C:\Program Files (x86)\GRASS GIS
7.1.svn/scripts/db.in.ogr.py", line 77, in main
    grass.write_command('db.execute', input = '-', stdin =
"DROP TABLE %s" % output)
  File "C:\Program Files (x86)\GRASS GIS
7.1.svn\etc\python\grass\script\core.py", line 483, in
write_command
    return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\Program Files (x86)\GRASS GIS
7.1.svn\etc\python\grass\script\core.py", line 308, in
handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['db.execute', 'input=-', 'stdin=DROP TABLE summary'] ended
with error
Process ended with non-zero return code 1. See errors in the
(error) output.

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

------------------------------
Output of r.stream.stats:
Summary:
Max order | Tot.N.str. | Tot.str.len. | Tot.area. | Dr.dens. | Str.freq.
  (num) | (num) | (km) | (km2) | (km/km2) | (num/km2)
        4 | 47 | 26.4605 | 7.9101 | 3.3452 | 5.9418
Stream ratios based on regresion coefficient:
Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt.
  3.2413 | 1.2265 | 3.5856 | 1.6621 | 1.7310
Avaraged stream ratios with standard deviations:
Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt.
  4.6667 | 1.7001 | 4.1945 | 1.9270 | 2.0256
  4.6188 | 1.2717 | 5.4587 | 0.8586 | 0.9290
Order | Avg.len | Avg.ar | Avg.sl | Avg.grad. | Avg.el.dif
num | (km) | (km2) | (m/m) | (m/m) | (m)
    1 | 0.4573 | 0.1462 | 0.0328 | 0.0254 | 9.7057
    2 | 1.3953 | 1.5154 | 0.0128 | 0.0106 | 13.4085
    3 | 0.7346 | 3.3597 | 0.0134 | 0.0109 | 9.4618
    4 | 1.1185 | 7.9101 | 0.0059 | 0.0040 | 4.5139
Order | Std.len | Std.ar | Std.sl | Std.grad. | Std.el.dif
num | (km) | (km2) | (m/m) | (m/m) | (m)
    1 | 0.3874 | 0.1177 | 0.0207 | 0.0138 | 6.2704
    2 | 2.1832 | 2.3181 | 0.0099 | 0.0091 | 16.5566
    3 | 0.8267 | 3.0598 | 0.0009 | 0.0034 | 11.5751
    4 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000
Order | N.streams | Tot.len (km) | Tot.area (km2)
    1 | 40 | 18.2917 | 5.8473
    2 | 4 | 5.5811 | 6.0615
    3 | 2 | 1.4691 | 6.7194
    4 | 1 | 1.1185 | 7.9101
Order | Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt. | d.dens. | str.freq.
    1 | 10.0000 | 3.0512 | 0.0000 | 2.5727 | 2.3961 | 3.1282 | 6.8408
    2 | 2.0000 | 0.5265 | 10.3663 | 0.9526 | 0.9685 | 0.9207 | 0.6599
    3 | 2.0000 | 1.5227 | 2.2171 | 2.2558 | 2.7122 | 0.2186 | 0.2976
    4 | 0.0000 | 0.0000 | 2.3544 | 0.0000 | 0.0000 | 0.1414 | 0.1264
(Sun Dec 14 17:12:49 2014) Command finished (40 sec)

Thanks,
Andrea.

Gesendet: Montag, 15. Dezember 2014 um 00:17 Uhr
Von: "Helmut Kudrnovsky" <hellik@web.de>
An: grass-user@lists.osgeo.org
Betreff: Re: [GRASS-user] Problem with r.basin in grass7
hi Andrea,

I set again the area and resolution with g.region before running r.basin. I

also deleted all files except my >DEM.

Now I get a different error ...

When I run
"r.basin map=map@Elevation prefix=o coordinates=-71.10394196,43.9865230801

threshold=19005 >dir=C:\\Users\\Andrea\\Basins"

ERROR: Region resolution and raster map <o_map_strahler> resolution

differs. Run 'g.region >rast=o_map_strahler' to set proper region
resolution"

please test r.basin with the NC data sample data for GRASS: GRASS 7 full
data tar.gz | zip (nc_spm, 145MB)
(http://grass.osgeo.org/download/sample-data/)

and have a look at http://grasswiki.osgeo.org/wiki/R.basin#Usage[http://grasswiki.osgeo.org/wiki/R.basin\#Usage\] for a
r.basin usage with this NC sample data (the wiki needs some update, feel
free to contribute...)

tested here with NC data sample data (with coordinates taken from the wiki),
it works without any error.

please try following commands (just copy/paste it and adapt only the path to
the output directory) within the NC sample data set:

g.region -p -a raster=elevation@PERMANENT align=elevation@PERMANENT

r.basin map=elevation@PERMANENT prefix=a
coordinates=636654.791181,218824.126649 dir=C:\tmp\rbasin threshold=20

and then report back.

[p.s. could you send text emails to the ML instead of hmtl mails? it's more
readable in the ML archive]

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5177835.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

r.basin map=elev_ned_30m@PERMANENT <=

My result of g.region -p is:
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5 <=
ewres: 28.5 <=
rows: 475
cols: 527
cells: 250325

are you setting your region to match elev_ned_30m@PERMANENT?

here:

r.info map=elev_ned_30m@PERMANENT

+----------------------------------------------------------------------------+
| Map: elev_ned_30m@PERMANENT Date: Tue Nov 7 00:35:18 2006
|
| Mapset: PERMANENT Login of Creator: helena
|
| Location: nc_spm_08_grass7
|
| DataBase: C:\grassdata
|
| Title: South-West Wake county: National Elevation Data 30m (
elev_ned30 |
| Timestamp: none
|

|----------------------------------------------------------------------------|
|
|
| Type of Map: raster Number of Categories: 255
|
| Data Type: FCELL
|
| Rows: 450
|
| Columns: 500
|
| Total Cells: 225000
|
| Projection: Lambert Conformal Conic
|
| N: 228500 S: 215000 Res: 30 <=
|
| E: 645000 W: 630000 Res: 30 <=
|
| Range of data: min = 55.1736 max = 156.3865
|
|
|
| Data Description:
|
| generated by r.proj
|
|
|
| Comments:
|
| r.proj input="ned1arcsec" location="northcarolina_latlong" mapset="h\
|
| elena" output="elev_ned30m" method="cubic" resolution=30
|
|
|

+----------------------------------------------------------------------------+

nsres: 28.5 vs 30?

please copy/paste this command:

g.region -a raster=elev_ned_30m@PERMANENT align=elev_ned_30m@PERMANENT

this means: matching region extent to raster DEM _and_ align cells to raster
DEM

here I get:

g.region -p -a raster=elev_ned_30m@PERMANENT align=elev_ned_30m@PERMANENT
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 30 <=
ewres: 30 <=
rows: 450
cols: 500
cells: 225000

tested your command here on my side:

r.basin map=elev_ned_30m@PERMANENT prefix=b
coordinates=636654.791181,218824.126649 dir=C:\tmp\test threshold=40
[...]
(Mon Dec 15 09:13:17 2014) Befehl ausgeführt (4 Min 53 Sek)

r.basin finishes without any error.

ERROR: Error while executing: 'DROP TABLE summary'
Traceback (most recent call last):
[...]

no idea about this one ...

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5177858.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi Helmut !

I thought that using the -a in g.region was enough … I did not know that I had to include also align=elev_ned_30m@PERMANENT.
Now I have r.info and g.region with the same values.

I run the r.basin command and it finished !!! However, I do get 2 blocks of warnings … Are they important ?

Here they are:
"

Reading raster map <t_elev_ned_30m_strahler>…
Reading raster map <t_elev_ned_30m_drainage_e>…
Reading raster map <r_elevation_crop>…
WARNING: Width for column x set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column y set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Easting_Centroid_basin set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Northing_Centroid_basin set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Rectangle_containing_basin_N_W set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Rectangle_containing_basin_S_E set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Area_of_basin_km2 set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Perimeter_of_basin_km set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Max_Elevation set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Min_Elevation set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Elevation_Difference set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Mean_Elevation set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Mean_Slope set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Length_of_Directing_Vector_km set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Prevalent_Orientation_deg_from_north_ccw set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Compactness_Coefficient set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Circularity_Ratio set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Topological_Diameter set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Elongation_Ratio set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Shape_Factor set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Concentration_Time_hr set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Length_of_Mainchannel_km set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Mean_slope_of_mainchannel_percent set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Mean_hillslope_length_m set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Magnitudo set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Max_order_Strahler set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Number_of_streams set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Total_Stream_Length_km set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column First_order_stream_frequency set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Drainage_Density_km_over_km2 set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Bifurcation_Ratio_Horton set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Length_Ratio_Horton set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Area_ratio_Horton set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: Width for column Slope_ratio_Horton set to 255 (was not specified by OGR), some strings may be truncated!
WARNING: 1 feature without geometry skipped
Imported table

with 1 rows
Forcing …

"

And at the end:
"

Order | Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt. | d.dens. | str.freq.
1 | 10.0000 | 3.0512 | 0.0000 | 2.5727 | 2.3961 | 3.1282 | 6.8408
2 | 2.0000 | 0.5265 | 10.3663 | 0.9526 | 0.9685 | 0.9207 | 0.6599
3 | 2.0000 | 1.5227 | 2.2171 | 2.2558 | 2.7122 | 0.2186 | 0.2976
4 | 0.0000 | 0.0000 | 2.3544 | 0.0000 | 0.0000 | 0.1414 | 0.1264
WARNING: ‘windows/original’ was found in more mapsets (also found in )
WARNING: Using original@landsat
(Mon Dec 15 17:49:10 2014) Command finished (1 min 39 sec)
"

Thanks,
Andrea.

Gesendet: Montag, 15. Dezember 2014 um 09:29 Uhr
Von: “Helmut Kudrnovsky” hellik@web.de
An: grass-user@lists.osgeo.org
Betreff: Re: [GRASS-user] Problem with r.basin in grass7

r.basin map=elev_ned_30m@PERMANENT <=

My result of g.region -p is:
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5 <=
ewres: 28.5 <=
rows: 475
cols: 527
cells: 250325

are you setting your region to match elev_ned_30m@PERMANENT?

here:

r.info map=elev_ned_30m@PERMANENT

±---------------------------------------------------------------------------+
| Map: elev_ned_30m@PERMANENT Date: Tue Nov 7 00:35:18 2006
|
| Mapset: PERMANENT Login of Creator: helena
|
| Location: nc_spm_08_grass7
|
| DataBase: C:\grassdata
|
| Title: South-West Wake county: National Elevation Data 30m (
elev_ned30 |
| Timestamp: none
|

|----------------------------------------------------------------------------|
|
|
| Type of Map: raster Number of Categories: 255
|
| Data Type: FCELL
|
| Rows: 450
|
| Columns: 500
|
| Total Cells: 225000
|
| Projection: Lambert Conformal Conic
|
| N: 228500 S: 215000 Res: 30 <=
|
| E: 645000 W: 630000 Res: 30 <=
|
| Range of data: min = 55.1736 max = 156.3865
|
|
|
| Data Description:
|
| generated by r.proj
|
|
|
| Comments:
|
| r.proj input=“ned1arcsec” location=“northcarolina_latlong” mapset=“h
|
| elena” output=“elev_ned30m” method=“cubic” resolution=30
|
|
|

±---------------------------------------------------------------------------+

nsres: 28.5 vs 30?

please copy/paste this command:

g.region -a raster=elev_ned_30m@PERMANENT align=elev_ned_30m@PERMANENT

this means: matching region extent to raster DEM and align cells to raster
DEM

here I get:

g.region -p -a raster=elev_ned_30m@PERMANENT align=elev_ned_30m@PERMANENT
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 30 <=
ewres: 30 <=
rows: 450
cols: 500
cells: 225000

tested your command here on my side:

r.basin map=elev_ned_30m@PERMANENT prefix=b
coordinates=636654.791181,218824.126649 dir=C:\tmp\test threshold=40
[…]
(Mon Dec 15 09:13:17 2014) Befehl ausgeführt (4 Min 53 Sek)

r.basin finishes without any error.

ERROR: Error while executing: ‘DROP TABLE summary’
Traceback (most recent call last):
[…]

no idea about this one …


best regards
Helmut

View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5177858.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

Hi Andrea,

On Mon, Dec 15, 2014 at 5:58 PM, Andrea Timmermann <timmermann@gmx.at> wrote:

Hi Helmut !

I thought that using the -a in g.region was enough ... I did not know that I
had to include also align=elev_ned_30m@PERMANENT.

They are addressing different things:
- the flag -a aligns to a requested resolution (res=xxx)
- the parameter align= aligns the pixel position and resolution to a
specified raster map

Now I have r.info and g.region with the same values.

Great!

Markus

I run the r.basin command and it finished !!!!

great!

I do get 2 blocks of warnings ... Are they important ?

Here they are:
"
....
Reading raster map <t_elev_ned_30m_strahler>...
Reading raster map <t_elev_ned_30m_drainage_e>...
Reading raster map <r_elevation_crop>...
WARNING: Width for column x set to 255 (was not specified by OGR), some

strings may be truncated!

WARNING: Width for column y set to 255 (was not specified by OGR), some

strings may be truncated!

these warnings come from the underlying involved ogr/gdal library and can't
be suppressed. these can be ignored.

WARNING: 'windows/original' was found in more mapsets (also found in

<PERMANENT>)

WARNING: Using <original@landsat>

the original region is stored in the beginning of a r.basin run and restored
in the finish of the r.basin run. your multiple "original" seems to be a
left over of earlier r.basin runs (?). you can remove these by g.remove
type=region ....

by r63549
(http://lists.osgeo.org/pipermail/grass-commit/2014-December/034459.html)
I've added it to the r.basin script to do it autmatically.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5177945.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi, thanks for the answers!!

I still have a problem, since my DEMs have a very high resolution. I tried to run r.basin using a lower resolution of the DEMs, but I do get an error.

I am using the NC database. First I run r.basin with the DEM at the original resolution. Then I adjusted the resolution of g.region, resampled my DEM, re-adjusted the g.region settings and finally re-run r.basin. Here are all my steps.

A) Run r.basin using the original DEM
A1) Set the region and checked r.info for the DEM

g.region -a raster=elev_ned_30m@PERMANENT align=elev_ned_30m@PERMANENT

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 30
ewres: 30
rows: 450
cols: 500
cells: 225000

r.info map=elev_ned_30m@PERMANENT
+----------------------------------------------------------------------------+
| Map: elev_ned_30m@PERMANENT Date: Tue Nov 7 00:35:18 2006 |
| Mapset: PERMANENT Login of Creator: helena |
| Location: nc_spm_08_grass7 |
| DataBase: C:\Users\Andrea\Documents\grassdata |
| Title: South-West Wake county: National Elevation Data 30m ( elev_ned30 |
| Timestamp: none |
|----------------------------------------------------------------------------|
| |
| Type of Map: raster Number of Categories: 255 |
| Data Type: FCELL |
| Rows: 450 |
| Columns: 500 |
| Total Cells: 225000 |
| Projection: Lambert Conformal Conic |
| N: 228500 S: 215000 Res: 30 |
| E: 645000 W: 630000 Res: 30 |
| Range of data: min = 55.1736 max = 156.3865 |
| |
| Data Description: |
| generated by r.proj |
| |
| Comments: |
| r.proj input="ned1arcsec" location="northcarolina_latlong" mapset="h\ |
| elena" output="elev_ned30m" method="cubic" resolution=30 |
| |

A2) Run r.basin

r.basin --verbose --overwrite map=elev_ned_30m@PERMANENT prefix=a dir=C:\Users\Andrea\t20 threshold=40 coordinates=636654.791181,218824.126649

I got the "DROP TABLE" error again, but since it is at the end and it still gives all the results I think I will just ignore it

“....
Reading raster map <a_elev_35_strahler>...
Reading raster map <a_elev_35_drainage_e>...
Reading raster map <r_elevation_crop>...
ERROR: Error while executing: 'DROP TABLE summary'
...

B) Run r.basin using a lower resolution DEM
B1) I changed the resolution of the computational region

g.region res=35

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 34.97409326
ewres: 34.96503497
rows: 386
cols: 429
cells: 165594

B2) Resampled my DEM and readjusted the computational region

r.resample --overwrite --verbose input=elev_ned_30m@PERMANENT output=elev_35

g.region -a --overwrite raster=elev_35@user1 align=elev_35@user1

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 34.97409326
ewres: 34.96503497
rows: 386
cols: 429
cells: 165594

r.info map=elev_35
+----------------------------------------------------------------------------+
| Map: elev_35 Date: Tue Nov 7 00:35:18 2006 |
| Mapset: user1 Login of Creator: helena |
| Location: nc_spm_08_grass7 |
| DataBase: C:\Users\Andrea\Documents\grassdata |
| Title: South-West Wake county: National Elevation Data 30m ( elev_ned30 |
| Timestamp: none |
|----------------------------------------------------------------------------|
| |
| Type of Map: raster Number of Categories: 0 |
| Data Type: FCELL |
| Rows: 386 |
| Columns: 429 |
| Total Cells: 165594 |
| Projection: Lambert Conformal Conic |
| N: 228500 S: 215000 Res: 34.97409326 |
| E: 645000 W: 630000 Res: 34.96503497 |
| Range of data: min = 55.77085 max = 156.3865 |
| |
| Data Description: |
| generated by r.proj |
| |
| Comments: |
| r.proj input="ned1arcsec" location="northcarolina_latlong" mapset="h\ |
| elena" output="elev_ned30m" method="cubic" resolution=30 |
| |

B3) Run r.basin

r.basin --verbose --overwrite map=elev_35 prefix=a coordinates=636654.791181,218824.126649 dir=C:\Users\Andrea\F threshold=40

Get this error:
“....
Updating attributes...
r.to.vect complete.
All in RAM calculation...
ERROR: Region resolution and raster map <a_elev_35_strahler> resolution differs. Run 'g.region rast=a_elev_35_strahler' to set proper region resolution.

Checked a_elev_35_strahler, which is the same as in g.region -p

r.info map=a_elev_35_strahler
+----------------------------------------------------------------------------+
| Map: a_elev_35_strahler Date: Tue Dec 16 20:13:24 2014 |
| Mapset: user1 Login of Creator: Andrea |
| Location: nc_spm_08_grass7 |
| DataBase: C:\Users\Andrea\Documents\grassdata |
| Title: ( a_elev_35_strahler ) |
| Timestamp: none |
|----------------------------------------------------------------------------|
| |
| Type of Map: raster Number of Categories: 0 |
| Data Type: CELL |
| Rows: 386 |
| Columns: 429 |
| Total Cells: 165594 |
| Projection: Lambert Conformal Conic |
| N: 228500 S: 215000 Res: 34.97409326 |
| E: 645000 W: 630000 Res: 34.96503497 |
| Range of data: min = 1 max = 3 |
| |
| Data Description: |
| generated by r.stream.order |
| |
| Comments: |
| r.stream.order stream_rast="a_elev_35_stream_e" direction="a_elev_35\ |
| _drainage_e" strahler="a_elev_35_strahler" horton="a_elev_35_horton"\ |
| shreve="a_elev_35_shreve" hack="a_elev_35_hack" memory=300 |
| |

Tried anyways what the error message suggested:

g.region rast=a_elev_35_strahler

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 34.97409326
ewres: 34.96503497
rows: 386
cols: 429
cells: 165594

And rerun r.basin:

r.basin --verbose --overwrite map=elev_35 prefix=a coordinates=636654.791181,218824.126649 dir=C:\Users\Andrea\F threshold=40


...
ERROR: Region resolution and raster map <a_elev_35_strahler> resolution differs. Run 'g.region rast=a_elev_35_strahler' to set proper region resolution.

Thanks!

Gesendet: Montag, 15. Dezember 2014 um 22:42 Uhr
Von: "Helmut Kudrnovsky" <hellik@web.de>
An: grass-user@lists.osgeo.org
Betreff: Re: [GRASS-user] Problem with r.basin in grass7

I run the r.basin command and it finished !!!!

great!

I do get 2 blocks of warnings ... Are they important ?

Here they are:
"
....
Reading raster map <t_elev_ned_30m_strahler>...
Reading raster map <t_elev_ned_30m_drainage_e>...
Reading raster map <r_elevation_crop>...
WARNING: Width for column x set to 255 (was not specified by OGR), some

strings may be truncated!

WARNING: Width for column y set to 255 (was not specified by OGR), some

strings may be truncated!

these warnings come from the underlying involved ogr/gdal library and can't
be suppressed. these can be ignored.

WARNING: 'windows/original' was found in more mapsets (also found in

<PERMANENT>)

WARNING: Using <original@landsat>

the original region is stored in the beginning of a r.basin run and restored
in the finish of the r.basin run. your multiple "original" seems to be a
left over of earlier r.basin runs (?). you can remove these by g.remove
type=region ....

by r63549
(http://lists.osgeo.org/pipermail/grass-commit/2014-December/034459.html)
I've added it to the r.basin script to do it autmatically.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-r-basin-in-grass7-tp5169155p5177945.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