1

I have a point shapefile I am trying to run the GRASS v.surf.idw tool on in python. Here is a link to the data: https://github.com/tanyahelena/qgis_data

I have a short script which runs. I don't get an error message, but I also get no result. What am I doing wrong?

import processing

parameters = {
    'input' : '/Users/ep9k/Desktop/qgis_data-master/area3_testdata_clipped.shp',
    'npoints' : 12,
    'power' : 2,
    'column' : 'PDOP',
    'GRASS_REGION_PARAMETER' : '-116.04415744105579,-116.0047567429083,37.029018114312905,37.054281406967974 [EPSG:4326]',
    'GRASS_REGION_CELLSIZE_PARAMETER' : 0,
    'GRASS_RASTER_FORMAT_OPT' : '',
    'GRASS_RASTER_FORMAT_META' : '',
    'GRASS_SNAP_TOLERANCE_PARAMETER' : -1,
    'GRASS_MIN_AREA_PARAMETER' : 0.0001,
    'output' : '/Users/ep9k/Desktop/GRASS_OUTPUT.tif'}

processing.runAndLoadResults('grass7:v.surf.idw', parameters)

I have been able to run the tool using the 'IDW Interpolation' tool, native to QGIS but I struggle with GRASS tools.

  • Are you running "QGIS Desktop 3.x with GRASS 7.x.exe"? – Joseph May 24 '19 at 9:52
  • I'm using QGIS 3.4 and GRASS 7.4. Sorry I did not clarify that – Erich Purpur May 24 '19 at 11:05
  • 1
    That's fine, your code works on QGIS 3.6 though so perhaps you could try updating your version? – Joseph May 24 '19 at 11:12
  • I upgraded to 3.6 and it worked. Thanks @Joseph – Erich Purpur May 25 '19 at 15:55