[OSGeoJapan-discuss] Pythonコンソールでprocessing処理の方法

NUIMURA, Takayuki tnuimura @ cis.ac.jp
2015年 11月 1日 (日) 23:28:39 PST


大庭さま、


縫村です。
grass:r.slopeアルゴリズムの残りのパラメーターも指定してみてはどうでしょうか?


processing.runalg("grass:r.slope",baseName,0,0,1,0,True,
*入力ラスタの範囲,0,outName)

*入力ラスタの範囲は例えば以下のように西端、東端、南端、北端とカンマ区切りで入力してダブルクォーテーションではさみます
"140.75,140.874999998,35.6833333342,35.75"

ちなみにoutNameじゃなくてtemporaryの場合は
processing.runalg("grass:r.slope",baseName,0,0,1,0,True, *入力ラスタの範囲,0,None)

とします。


2015-11-02 13:39 GMT+09:00 tys <t.oba @ tys-yokohama.co.jp>:

> メーリングリスト 各位
>
> QGIS 2.10でPythonコンソールから"grass:r.slope"を呼び出して表示させようと考えています。
>
> 最終的には、斜面危険度のpluginを作成する予定です。
>
> pythonコンソール上で
> 1.import processing
> 2.baseName = "F:/matsumoto/kiban_map/merge_bicubic_2450.tif"
> 3.iface.addRasterLayer(baseName, "dem")
> 4.outName = "F:/matsumoto/kiban_map/slope.tif"
> 5.processing.runalg("grass:r.slope",baseName, outName)
> 6.iface.addRasterLayer(outName, "slope")
> 実行させると
> <http://osgeo-org.1560.x6.nabble.com/file/n5233818/image01.jpg>
> のエラーが出ます。
>
> これは、"grass:r.slope"がうまく計算されておらずに、outNameに出力されていないことと
> 考えられます。
>
> pythonコンソール上でprocessingを動かすにはどのようにすればよいのでしょうか?
>
> また、出力ラスター名であるoutNameをtemporaryに出力したい場合の設定方法についても
> どのようにすればよいのでしょうか?
>
> よろしくお願いします。
>
>
>
>
> -----
> /****************************/
> 合同会社TYS
> 技術開発部
> 大庭哲哉
> http://www.disaster-software.net/
> http://blog.godo-tys.jp/
> /****************************/
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Python-processing-tp5233818.html
> Sent from the OSGeo Japan Local Chapter mailing list archive at Nabble.com.
> _______________________________________________
> OSGeoJapan-discuss mailing list
> OSGeoJapan-discuss @ lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/osgeojapan-discuss




-- 
Takayuki NUIMURA
Department of Environmental Risk and Crisis Management,
Faculty of Risk and Crisis Management,
Chiba Institute of Science
15-8 Shiomi-cho, Choshi, Chiba 288-0025
Phone:0479-30-4536

縫村崇行
千葉科学大学・危機管理学部・環境危機管理学科
〒288-0025 千葉県銚子市潮見町15-8
Phone:0479-30-4536

E-mail: tnuimura @ cis.ac.jp
Skype: t_nuimura
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://lists.osgeo.org/pipermail/osgeojapan-discuss/attachments/20151102/02fa15fe/attachment.html>


More information about the OSGeoJapan-discuss mailing list