Skip to content
Prev 18714 / 29559 Next

Adding SQL "where" to readOGR

On Wed, 3 Jul 2013, Barry Rowlingson wrote:

            
Yes, the build train for libgdal; and yes, libgdal can and does exist 
without GEOS.
The error and warning messages from GDAL are often short and opaque, 
including empty layers. For medium-sized data sets, subsetting is 
certainly easier on the R side; for large ones, using ogr2ogr to select 
before import is a viable option.

They may very well also be interesting encoding challenges, because R and 
OGR may (and do) disagree on protocols for handling encoding, for example 
of placenames. A lot are in CP1252 or other variants, few are UTF-8, etc. 
So the search string going from R to OGR may need to know about the 
expected encoding on the "other" side to return hits. If the match should 
be of where=paste("bydel ==", shQuote("?sane")) or some such, the outcome 
will depend on the way encoding is handled.

I'm sure it will be fun!

Roger