How to create loops using processing algorithm in python console from QGIS

المشرف العام

Administrator
طاقم الإدارة
I'm new with python programming and I need some help for my case.I want to use inverse distance weighted function to interpolate precipitation values using values from 78 weather stations. so I create this sequence of processing algorithms that run perfectly one time and produce an interpolate raster layer as I wantedbold.The problem is that I wanted to run these sequence all the times I need. All bold "9" values in code should be run to numbers 2, 3, 4 ..., 10, including number 10.Any ideas for helping me?

processing.runalg("qgis:joinattributestable", "D:\PATRICIA\IG\QGIS\DIST_COSTA_etrs89.shp", "D:\PATRICIA\DOCUMENTOS\ESTACOES METEOROLOGICAS\DADOS METEOROLOGICOS\HR\H_1999_1_**9**.xlsx", "EST", "num", "D:\PATRICIA\IG\QGIS\FWI\HR\ETACOES_HR_1999_1_**9**")processing.runalg("qgis:selectbyattribute", "D:\PATRICIA\IG\QGIS\FWI\HR\ETACOES_HR_1999_1_**9**.shp", "H", 1, "NULL", "D:\PATRICIA\IG\QGIS\FWI\HR\ETACOES_HR_1999_1_**9**.shp")processing.runalg("qgis:saveselectedfeatures", "D:\PATRICIA\IG\QGIS\FWI\HR\ETACOES_HR_1999_1_**9**.shp", "D:\PATRICIA\IG\QGIS\FWI\HR\ESTACOES_HR_1999_1_**9**_SF_Int.shp")processing.runalg("qgis:selectbyattribute", "D:\PATRICIA\IG\QGIS\FWI\HR\ESTACOES_HR_1999_1_**9**_SF_Int.shp", "H", 1, "-999.9", "D:\PATRICIA\IG\QGIS\FWI\HR\ESTACOES_HR_1999_1_**9**_SF_Int.shp")processing.runalg("qgis:saveselectedfeatures", "D:\PATRICIA\IG\QGIS\FWI\HR\ESTACOES_HR_1999_1_**9**_SF_Int.shp", "D:\PATRICIA\IG\QGIS\FWI\HR\ESTACOES_HR_1999_1_**9**_SF.shp")processing.runalg("saga:inversedistanceweighted", "D:\PATRICIA\IG\QGIS\FWI\HR\ESTACOES_HR_1999_1_**9**_SF.shp", "H", 0, 2, 0, 1, 100, 0, 0, 8, "-152444.0, 180000.0, -302911.0, 280000.0", 100, "D:\PATRICIA\IG\QGIS\FWI\HR\Python_HR_Viz8_Cell100_**9**")

أكثر...
 
أعلى