Skip to content
Back to formatted view

Raw Message

Message-ID: <49CBEB4F.4060905@zevross.com>
Date: 2009-03-26T20:53:35Z
From: Zev Ross
Subject: RPyGeo Query -- probably easy

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

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

Where the sticking point is hrwk05 <> 0. In Python my query would be 
double quote, field name, close double quote, comparison, number e.g, 
"hrwk05" <> 0 but I'm not sure how to put this into RPyGeo

If I run like so:

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

it runs.

Thank you in advance for assistance.

Zev

-- 
Zev Ross
ZevRoss Spatial Analysis
120 N Aurora, Suite 3A
Ithaca, NY 14850
607-277-0004 (phone)
866-877-3690 (fax, toll-free)
zev at zevross.com