Skip to content
Prev 5406 / 29559 Next

RPyGeo Query -- probably easy

Hi Zev,

the problems are definitely your quotes. First, they are syntactically 
incorrect - I count seven double quotes (I recommend using some editor 
with syntax highlighting, like Tinn-R or R-WinEdt, this helps discover 
mismatches). Second, escaping them (\") should allow you to put double 
quotes inside a double-quoted character string.

This might be closer to what you want to do (but I haven't tried to run 
it - sorry, busy end of term...):

rpygeo.geoprocessor("makefeaturelayer('X:\\abc.shp','walk')",
     "SelectLayerByAttribute('walk','NEW_SELECTION','\"hrwk05\"<>0')",
     env=myenv)

Note that an additional argument clean.up=FALSE to the 
rpygeo.geoprocessor allows you to inspect the Python file to check 
whether the quotes are syntactically correct in Python.

I hope this helps
  Alex
Zev Ross wrote: