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.

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to