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

tys t.oba @ tys-yokohama.co.jp
2015年 11月 2日 (月) 02:29:23 PST


縫村 様

ありがとうございます。

パラメータ等の省略はできないようですね。

下記のscriptで動きました。

from qgis.core import *
from PyQt4.QtCore import *
import processing

fileName = "F:/matsumoto/kiban_map/merge_bicubic_2450.tif"
fileInfo = QFileInfo(fileName)
baseName = fileInfo.baseName()
rlayer = QgsRasterLayer(fileName, baseName)
iface.addRasterLayer(fileName, baseName)
outName = "F:/matsumoto/kiban_map/slope.tif"

# raster extent
extent = rlayer.extent()

# xmin,ymin,xmax,ymax region
Extent = str(extent.xMinimum()) + "," + str(extent.yMinimum()) + "," +
str(extent.xMaximum()) + "," + str(extent.yMaximum())

# r.slope grass alg
processing.runalg("grass:r.slope", fileName, 0, 0, 1, 0, True, Extent, 0,
outName)
iface.addRasterLayer(outName, "slope")



-----
/****************************/
合同会社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-tp5233818p5233872.html
Sent from the OSGeo Japan Local Chapter mailing list archive at Nabble.com.


More information about the OSGeoJapan-discuss mailing list