How to add an interpolation raster from the python console in QGIS?

المشرف العام

Administrator
طاقم الإدارة
I'm trying to add an interpolation layer based on an existing vector layer by using the Python Console (initially in the menu Raster/Interpolation), but can't find anything related in the documentation.

I saw the QgsIDWInterpolator in the API, but can't get it working. It seems it expects a list of LayerData but it doesn't work neither. Here my current code :

ld=qgis.analysis.QgsIDWInterpolator.LayerDatald.vectorLayer=vlayerld.zCoordInterpolation=0ld.interpolationAttribute=5ld.mInputType=0ldlist=[ld]itp=qgis.analysis.QgsIDWInterpolator(ldlist)I get the following error for the last command :

Traceback (most recent call last): File "", line 1, in TypeError: arguments did not match any overloaded call: QgsIDWInterpolator(list-of-QgsInterpolator.LayerData): argument 1 has unexpected type 'list' QgsIDWInterpolator(QgsIDWInterpolator): argument 1 has unexpected type 'list'Thanks !



أكثر...
 
أعلى