3

I'm creating lots of raster files with grass:v.surf.rst so rather than using the graphical interface I wanted to use the python console (and potentially put in in a script at some point). However when I try and run a script copied from the history I get a syntax error if I include the WHERE SQL syntax. If I remove "x" <> 3.54 and just leave empty double quotes it works fine. An example of the code:

processing.runalg("grass:v.surf.rst","file://drive/filename.csv?type=csv&xField=x&yField=y&spatialIndex=no&subsetIndex=no&watchFile=no",""x" <> 3.54",None,"DD275",40,40,300,0.001,2.5,1,0,0,False,False,"1.5,5.25,20.5,32.5",0.1,-1,0.0001,"//drive/filename.tif",None,None,None,None,None)

Is there a different process for the where statement in the console?

  • I think there might be an issue with your double quotes. Try replacing ""x" <> 3.54" with 'x <> 3.54' – Joseph Nov 17 '15 at 11:26
  • Hi @Joseph, Sadly it doesn't seem to help, I've tried that one as well as: '"x" <> 3.54' and "x <> 3.54" and "'x' <> 3.54" and "x" <> 3.54 and 'x' <> 3.54 without luck. – Will Hore-Lacy Nov 18 '15 at 3:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.