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

2010-11-24 Thread Roger Bivand
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 ho

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

2010-11-24 Thread etiennebr
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)? Etienne -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/passing-SQL-through-readOGR-tp3816889p5770881.html Sent from the R-sig-geo m

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

2010-11-15 Thread Roger Bivand
On Mon, 15 Nov 2010, Tom Gottfried wrote: Hi Etienne, so far I only did it with points: data_frame <- sqlQuery(odbcConnect("yourdatabase"), "SELECT attr, ST_X(the_geom) AS x, ST_Y(the_geom) AS y FROM yourtable WHERE ...") coordinates(data_frame) <- ~x+y Because "OGR SQL has been reimpleme

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

2010-11-15 Thread Tom Gottfried
Hi Etienne, so far I only did it with points: data_frame <- sqlQuery(odbcConnect("yourdatabase"), "SELECT attr, ST_X(the_geom) AS x, ST_Y(the_geom) AS y FROM yourtable WHERE ...") coordinates(data_frame) <- ~x+y regards, Tom Am 15.11.2010 17:01, schrieb Etienne Bellemare: Thanks Tom,

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

2009-10-13 Thread Roger Bivand
On Tue, 13 Oct 2009, Tom Gottfried wrote: Hi list, is there a way to pass any SQL-statement through readOGR (as with the -sql Option to ogr2ogr). I want to import a subset of a large dataset from PostGIS into R. I know it's possible with for example RODBC and then coercing the resulting data

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

2009-10-13 Thread Barry Rowlingson
On Tue, Oct 13, 2009 at 4:34 PM, Tom Gottfried wrote: > Hi list, > > is there a way to pass any SQL-statement through readOGR (as with the -sql > Option to ogr2ogr). I > want to import a subset of a large dataset from PostGIS into R. I know it's > possible with for > example RODBC and then coerc

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

2009-10-13 Thread Tom Gottfried
Hi list, is there a way to pass any SQL-statement through readOGR (as with the -sql Option to ogr2ogr). I want to import a subset of a large dataset from PostGIS into R. I know it's possible with for example RODBC and then coercing the resulting data.frame to an sp-class, but I wonder if I can