Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-12-21 Thread Maarten van Strien
Hi, Thank you Alexander, your solution seems to work! Best, Maarten Hi, yes, the quotes are indeed tricky... The challenge is to provide the correct mix of escaped and un-escaped single and double quotes to Python / ArcGIS as in this Python example: gp.select_analysis("nfroads.shp", "pave

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-12-18 Thread Alexander Brenning
Hi, yes, the quotes are indeed tricky... The challenge is to provide the correct mix of escaped and un-escaped single and double quotes to Python / ArcGIS as in this Python example: gp.select_analysis("nfroads.shp", "paved.shp", ' "ROAD_CLASS" = \'PAVED\' ') In order to achieve this, the

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-12-18 Thread Maarten van Strien
Andrew, thanks for your reply! I tried exactly your command, but still the resulting rpygeo.py file contains the following line: gp.select_analysis( "nfroads.shp", "paved.shp", "\"ROAD_CLASS\" = 'PAVED' " ) So the \"ROAD_CLASS\" = 'PAVED' is still surrounded by double quotes ("). I have tried ma

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-12-18 Thread Crowe, Andrew
Lancaster Environment Centre Lancaster University LancasterLA1 4YQ UK From: r-sig-geo-boun...@stat.math.ethz.ch on behalf of Maarten van Strien Sent: Thu 17/12/2009 9:06 PM To: r-sig-geo@stat.math.ethz.ch Subject: Re: [R-sig-Geo] RPyGeo Query -- probably easy Hi All, I was wondering i

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-12-17 Thread Maarten van Strien
Hi All, I was wondering if anyone has found a solution to the mentioned problem, as I have a similar problem with a query function in RPyGeo. I am trying to use the 'select_analysis' ArcGIS function that uses an sql expression to select certain values/names from a field in an attribute table. Th

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-04-13 Thread Alexander Brenning
well, these are two separate Python commands: gp.makefeaturelayer("abc.shp", "walk") gp.SelectLayerByAttribute('walk','NEW_SELECTION','\"hrwk05\" <> 0') but this... > rpygeo.geoprocessor( > "makefeaturelayer('abc.shp','walk')", > "SelectLayerByAttribute('walk','NEW_SELECTION','\"hrwk05\" <> 0

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-04-13 Thread Roger Bivand
On Mon, 13 Apr 2009, Zev Ross wrote: Hi Alex, Thank you so much for the suggestion and apologies for taking so long to test it. I think the quotes are still a problem. I do indeed write all my code in R-WinEdt but must be doing something wrong. In Python your suggested escaped quotes works f

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-04-13 Thread Zev Ross
Hi Alex, Thank you so much for the suggestion and apologies for taking so long to test it. I think the quotes are still a problem. I do indeed write all my code in R-WinEdt but must be doing something wrong. In Python your suggested escaped quotes works fine but perhaps I missed something in

Re: [R-sig-Geo] RPyGeo Query -- probably easy

2009-04-01 Thread Alexander Brenning
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 q

[R-sig-Geo] RPyGeo Query -- probably easy

2009-03-26 Thread Zev Ross
Hi All, I'm wondering if anybody could give me a little guidance on formatting a query using RPyGeo. I'm excited to be able to run Python geoprocessing functions straight from R but am having trouble with the quote, double quote kinds of issues. Here's an example of what I'd like to run rpy