GRASS r.watershedのエラーについて

723 views
Skip to first unread message

山岡賢仁

unread,
Nov 5, 2016, 5:01:56 AM11/5/16
to QGIS初心者質問グループ
お世話になります。

プロセッシングツールのr.watershedを用いた解析を行いたいのですが、毎回以下のようなエラーが出てきてしまいできません。
どなたか解決方法をご存じないでしょうか?
elevationにDEMをAmount of overland flow per cellに降雨量データを入れています。
DEMのみでやっても同様のエラーが出てきます。

Converting outputs
出力レイヤの読み込み

The following layers were not correctly generated.
Number of cells that drain through each cell
Drainage direction
Unique label for each watershed basin
Stream segments
Half-basins
Slope length and steepness (LS) factor for USLE
Slope steepness (S) factor for USLE
Topographic index ln(a / tan(b))
You can check the log messages to find more information about the execution of the algorithm

ログを見ると

r.watershed - Watershed basin analysis program. アルゴリズムを開始しています...

g.proj -c proj4="+proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"

r.external input="C:/Users/uraomote/Desktop/elevation/elerectangle.tif" band=1 output=tmp1478335880054 --overwrite -o

r.external input="C:/Users/uraomote/Desktop/GIS forwatershed/Q estimation/rainmonth/2_5.tif" band=1 output=tmp1478335880055 --overwrite -o

g.region n=259970.188412 s=199759.558673 e=6584.44144193 w=-26415.5585581 res=9.76382894019

r.watershed elevation=tmp1478335880054 flow=tmp1478335880055 threshold="0" max_slope_length="0" convergence="5" memory="300" accumulation=accumulation9581e414a12e469685cb490c3738adc4 drainage=drainage9581e414a12e469685cb490c3738adc4 basin=basin9581e414a12e469685cb490c3738adc4 stream=stream9581e414a12e469685cb490c3738adc4 half_basin=half_basin9581e414a12e469685cb490c3738adc4 length_slope=length_slope9581e414a12e469685cb490c3738adc4 slope_steepness=slope_steepness9581e414a12e469685cb490c3738adc4 tci=tci9581e414a12e469685cb490c3738adc4 --overwrite

g.region raster=accumulation9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=accumulation9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\d98d44bca5b345f1a83985998b183d6b\accumulation.tif"

g.region raster=drainage9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=drainage9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\8b2017a479b74c3b9e12bcd216634ca4\drainage.tif"

g.region raster=basin9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=basin9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\d7c2617262b74a7ebdef02d2e2704ce2\basin.tif"

g.region raster=stream9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=stream9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\08e4e32e9898436e9675af7dd2a279c5\stream.tif"

g.region raster=half_basin9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=half_basin9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\57c115c9b53a483fba60a72562e35f4e\halfbasin.tif"

g.region raster=length_slope9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=length_slope9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\8852e3484d45451c82a5e540ad0f0f35\lengthslope.tif"

g.region raster=slope_steepness9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=slope_steepness9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\c89600cb6a7c4446b23db14bd049b00b\slopesteepness.tif"

g.region raster=tci9581e414a12e469685cb490c3738adc4

r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=tci9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\7d816dcfb58d440383fbd3531556aee3\tci.tif"



いつもここでとまるようで、下記の部分は薄く表示され実行されてないようです。


C:\PROGRA~2\QGIS2~1.18\bin>set HOME=C:\Users\uraomote


C:\PROGRA~2\QGIS2~1.18\bin>set GISRC=C:\Users\uraomote\.qgis2\\processing\processing.gisrc7


C:\PROGRA~2\QGIS2~1.18\bin>set WINGISBASE=C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5


C:\PROGRA~2\QGIS2~1.18\bin>set GISBASE=C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5


C:\PROGRA~2\QGIS2~1.18\bin>set GRASS_PROJSHARE=C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\share\proj


C:\PROGRA~2\QGIS2~1.18\bin>set GRASS_MESSAGE_FORMAT=plain


C:\PROGRA~2\QGIS2~1.18\bin>if "" == "" set PATH=C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\bin;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\lib;c:\progra~2\qgis2~1.18\apps\python27\lib\site-packages\shapely-1.2.18-py2.7-win32.egg\shapely\DLLs;C:\PROGRA~2\QGIS2~1.18\apps\Python27\DLLs;C:\PROGRA~2\QGIS2~1.18\apps\qgis\bin;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\lib;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\bin;C:\PROGRA~2\QGIS2~1.18\bin;C:\Windows\system32;C:\Windows;C:\Windows\WBem;C:\PROGRA~2\QGIS2~1.18\apps\Python27\Scripts


C:\PROGRA~2\QGIS2~1.18\bin>if not "" == "" set PATH=C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\bin;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\lib;;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\bin;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\lib;c:\progra~2\qgis2~1.18\apps\python27\lib\site-packages\shapely-1.2.18-py2.7-win32.egg\shapely\DLLs;C:\PROGRA~2\QGIS2~1.18\apps\Python27\DLLs;C:\PROGRA~2\QGIS2~1.18\apps\qgis\bin;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\lib;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\bin;C:\PROGRA~2\QGIS2~1.18\bin;C:\Windows\system32;C:\Windows;C:\Windows\WBem;C:\PROGRA~2\QGIS2~1.18\apps\Python27\Scripts


C:\PROGRA~2\QGIS2~1.18\bin>set GRASS_VERSION=7.0.0


C:\PROGRA~2\QGIS2~1.18\bin>if not "" == "" goto langset


C:\PROGRA~2\QGIS2~1.18\bin>FOR /F "usebackq delims==" %i IN (`"C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\etc\winlocale"`) DO @set LANG=%i


C:\PROGRA~2\QGIS2~1.18\bin>set PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY


C:\PROGRA~2\QGIS2~1.18\bin>set PYTHONPATH=;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\etc\python;C:\PROGRA~2\QGIS2~1.18\apps\grass\grass-7.0.5\etc\wxpython\n


C:\PROGRA~2\QGIS2~1.18\bin>g.gisenv.exe set="MAPSET=PERMANENT"


C:\PROGRA~2\QGIS2~1.18\bin>g.gisenv.exe set="LOCATION=temp_location"


C:\PROGRA~2\QGIS2~1.18\bin>g.gisenv.exe set="LOCATION_NAME=temp_location"


C:\PROGRA~2\QGIS2~1.18\bin>g.gisenv.exe set="GISDBASE=C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\grassdata"


C:\PROGRA~2\QGIS2~1.18\bin>g.gisenv.exe set="GRASS_GUI=text"


C:\PROGRA~2\QGIS2~1.18\bin>g.proj -c proj4="+proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"

Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default

Projection information updated


C:\PROGRA~2\QGIS2~1.18\bin>r.external input="C:/Users/uraomote/Desktop/elevation/elerectangle.tif" band=1 output=tmp1478335880054 --overwrite -o

Œx : Å—D æ‚Ì“Š‰eƒ`ƒFƒbƒN

Reading band 1 of 1...

r.external Š®—¹. Link to raster map created.


C:\PROGRA~2\QGIS2~1.18\bin>r.external input="C:/Users/uraomote/Desktop/GIS forwatershed/Q estimation/rainmonth/2_5.tif" band=1 output=tmp1478335880055 --overwrite -o

Œx : ƒf [ƒ^ƒ€ ‚ÍGRASS‚É”Fޝ‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ ‚»‚µ‚ăpƒ‰ƒ [ƒ^‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ

Œx : Å—D æ‚Ì“Š‰eƒ`ƒFƒbƒN

Reading band 1 of 1...

r.external Š®—¹. Link to raster map created.


C:\PROGRA~2\QGIS2~1.18\bin>g.region n=259970.188412 s=199759.558673 e=6584.44144193 w=-26415.5585581 res=9.76382894019


C:\PROGRA~2\QGIS2~1.18\bin>r.watershed elevation=tmp1478335880054 flow=tmp1478335880055 threshold="0" max_slope_length="0" convergence="5" memory="300" accumulation=accumulation9581e414a12e469685cb490c3738adc4 drainage=drainage9581e414a12e469685cb490c3738adc4 basin=basin9581e414a12e469685cb490c3738adc4 stream=stream9581e414a12e469685cb490c3738adc4 half_basin=half_basin9581e414a12e469685cb490c3738adc4 length_slope=length_slope9581e414a12e469685cb490c3738adc4 slope_steepness=slope_steepness9581e414a12e469685cb490c3738adc4 tci=tci9581e414a12e469685cb490c3738adc4 --overwrite

ƒGƒ‰ [: The basin threshold must be a positive number.


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=accumulation9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=accumulation9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\d98d44bca5b345f1a83985998b183d6b\accumulation.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=drainage9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=drainage9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\8b2017a479b74c3b9e12bcd216634ca4\drainage.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=basin9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=basin9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\d7c2617262b74a7ebdef02d2e2704ce2\basin.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=stream9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=stream9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\08e4e32e9898436e9675af7dd2a279c5\stream.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=half_basin9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=half_basin9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\57c115c9b53a483fba60a72562e35f4e\halfbasin.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=length_slope9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=length_slope9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\8852e3484d45451c82a5e540ad0f0f35\lengthslope.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=slope_steepness9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=slope_steepness9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\c89600cb6a7c4446b23db14bd049b00b\slopesteepness.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>g.region raster=tci9581e414a12e469685cb490c3738adc4

ƒGƒ‰ [: ƒ‰ƒXƒ^ƒ}ƒbƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=tci9581e414a12e469685cb490c3738adc4 output="C:\Users\uraomote\AppData\Local\Temp\processing05927e7ddc514aa59cfbe0eefc3e7117\7d816dcfb58d440383fbd3531556aee3\tci.tif"

ƒGƒ‰ [: ƒ‰ƒXƒ^ [ƒ}ƒbƒv‚Ü‚½‚̓Oƒ‹ [ƒv ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ


C:\PROGRA~2\QGIS2~1.18\bin>exit

Converting outputs

出力レイヤの読み込み


The following layers were not correctly generated.

  • Number of cells that drain through each cell
  • Drainage direction
  • Unique label for each watershed basin
  • Stream segments
  • Half-basins
  • Slope length and steepness (LS) factor for USLE
  • Slope steepness (S) factor for USLE
  • Topographic index ln(a / tan(b))

You can check the log messages to find more information about the execution of the algorithm




fukuoka....@gmail.com

unread,
Nov 5, 2016, 6:37:00 AM11/5/16
to QGIS初心者質問グループ

こんばんは


試しに使用したときにDEMのみでは同様にエラーが出ました。
Minimum size of exterior waterahed basin に数値の入力が必要なようです。

数値を変えて試しましたが、私の試したDEMでは入力数値を1000としたものがイメージと近かったです。
赤枠が流域のラスタをポリゴンに変換したものです。
値が小さいと、ラスタの見かけ上適正に見えても値が微妙に違う場合があるので、Value Toolで確認するか、ポリゴンに変換して確認すると良いと思います。

仕組みを理解した上での投稿ではありませんが、参考になれば幸いです。


東雲

unread,
Nov 5, 2016, 6:53:34 PM11/5/16
to QGIS初心者質問グループ
補足ですが。

Minimum size of exterior watershed basin というのは流域の最小面積です。
流域をすべて拾うとなると、地面のちょっとした凹凸まで全部計算して流域として認識することになり
かえって使いにくいうえに計算も表示も処理が膨大になるので、ある程度まとめる必要があります。
というわけでこの項目で、最小の流域としてまとめる面積を指定しています。
1000と入力すると1000平方メートルを最小にした流域を計算するということです。

fukuoka....@gmail.com

unread,
Nov 5, 2016, 9:13:17 PM11/5/16
to QGIS初心者質問グループ
東雲 様

補足説明ありがとうございます。
Minimum size of exterior watershed basin は流域の最小面積ではないかという気はしていたのですが、ポリゴンに変換したもので面積を拾ったところ
1ピクセルにあたる面積があったので確信が持てませんでした。

そこでご存じだったら教えて頂きたいのですが、これらは水たまりになっているところの様な気がします。
ちょっとした窪地を埋めるような処理が必要かと思いますが、「r.waterershed」内のパラメータ設定で対処するのでしょうか?
それともDEMに前処理するのでしょうか?


山岡 様

山岡さん立ち上げたスレッド内で、質問の投稿をして申し訳ありません。

東雲

unread,
Nov 5, 2016, 9:57:58 PM11/5/16
to QGIS初心者質問グループ
fukuoka様

河川をやっていたのがだいぶ前なので記憶が怪しいのですが、DEMの段階で前処理をしていたと思います。
標高差の最低値を指定するような処理をしていました。
ハイウォーターレベルがどれくらいの河川まで考慮するかとか、洲などで流路ネットワークが変に複雑化することがないようにとか
色々考えてパラメータは試行錯誤して決めていました。
検索しても自分が勉強したサイトに行きあたらないので根拠が出せなくて申し訳ないんですが。

fukuoka....@gmail.com

unread,
Nov 5, 2016, 10:24:43 PM11/5/16
to QGIS初心者質問グループ
東雲 様

早速のご回答ありがとうございます。
投稿を参考にして調べていきたいと思います。

山岡賢仁

unread,
Nov 5, 2016, 11:54:43 PM11/5/16
to QGIS初心者質問グループ
東雲様

ありがとうございます。無事動きました。
降雨量データが1kmメッシュのmm/月,であることを考えると、Number off cells that drain  trough each cells の単位は10^3×10^3×10^-2=10^4m^3という認識であっているでしょうか?

福岡様
福岡様の疑問を解消できる場になったのなら何よりです。

東雲

unread,
Nov 6, 2016, 1:05:25 AM11/6/16
to QGIS初心者質問グループ
降雨量の1kmメッシュだとたぶんいわゆる3次メッシュのことだと思います。
3次メッシュは距離ではなく度で規定されているので、1km×1kmのメッシュということではなく
「だいたい縦横1kmくらい」という感じなので
それぞれのメッシュの面積を計算してそれを基にしないと、場所によっては面積にして一割以上誤差が出ます。
そうすると面積当たりの降雨量にも影響してくるので注意が必要です。

Reply all
Reply to author
Forward
0 new messages