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

Maarten van Strien maarten at vstrien.nl
Fri Dec 18 11:16:16 CET 2009


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 many different Python commands, but the only one working for me
is:

gp.select_analysis( "nfroads.shp", "paved.shp", ' "ROAD_CLASS" = \'PAVED\' '
)

Somehow I need to instruct RPyGeo to leave away the double quotes and
replace them by single quotes.

Kind regards, Maarten



Maarten
 
I'm not sure about the single quotes but possibly you could add an extra
special character break (the \ ) to indicate to python that the double
quotes surrounding your field name are not the end of a string.  You could
try the following code:
 
rpygeo.geoprocessor("select_analysis", c("nfroads.shp", "paved.shp", '
\\"ROAD_CLASS\\" = \'PAVED\' '), py.file= "rpygeo.py", working.directory =
 wrkspc, env = myenv, clean.up = FALSE)

 
Best Regards
 
Andrew
 
Dr Andrew Crowe
 
Lancaster Environment Centre
Lancaster University
Lancaster    LA1 4YQ
UK
-- 
View this message in context: http://n2.nabble.com/RPyGeo-Query-probably-easy-tp2766675p4185819.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list