[R-sig-Geo] passing SQL through readOGR()

Roger Bivand Roger.Bivand at nhh.no
Wed Nov 24 17:16:19 CET 2010


On Wed, 24 Nov 2010, etiennebr wrote:

>
> Roger,
>
> I'd be happy to help. If I get it correct, the only missing piece is a WKB
> or WKT driver to convert to sp class (and vice-versa)?

Thanks for the offer, rgdal is now hosted on R-forge for anonymous 
checkout. The prefered approach is to find out how to use:

http://www.gdal.org/ogr/ogr_sql.html

and

http://trac.osgeo.org/gdal/wiki/rfc28_sqlfunc

and its forthcoming extensions in GDAL 1.8.0 in setting an attribute 
filter before importing using OGR, rather than looking at drivers, which 
OGR handles. The same attribute SQL selections should then work across all 
drivers. It may be possible to try a prototype with the existing mixture 
of R and C/C++ in readOGR(), but a fresh prototype with more done in C/C++ 
is probably the best bet, passing the SQL string out to the OGR SQL 
engine directly, and letting it do all the work.

Roger

>
> Etienne
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list