Re: [GENERAL] [postgis-users] Query with LIMIT but as random result set?

2013-01-11 Thread Gavin Flower
On 12/01/13 06:45, Bosco Rama wrote: On 01/11/13 09:31, Gavin Flower wrote: -- theta in radians -- for radius = 100 INSERT INTO ranpoint (id, theta, r) VALUES (generate_series(1, 10), pi() * random(), 100 * random()); Shouldn't the value for theta be: 2 * pi() * random() Bos

Re: [GENERAL] [postgis-users] Query with LIMIT but as random result set?

2013-01-11 Thread Bosco Rama
On 01/11/13 09:31, Gavin Flower wrote: > -- theta in radians > -- for radius = 100 > > INSERT INTO ranpoint > (id, theta, r) > VALUES > (generate_series(1, 10), pi() * random(), 100 * random()); Shouldn't the value for theta be: 2 * pi() * random() Bosco. -- Sent via pgsql-gene

Re: [GENERAL] [postgis-users] Query with LIMIT but as random result set?

2013-01-10 Thread Kevin Grittner
Stefan Keller wrote: > "... ORDER BY random() LIMIT 10;" works ok. > > But with the following option it gets more tricky assume: >> And as an option the (limited) resultset should be spatially >> distributed (not clustered). > > I'm thinking about some radial spatial distribution function. So,

Re: [GENERAL] [postgis-users] Query with LIMIT but as random result set?

2013-01-08 Thread Stefan Keller
Hi, Thanks a lot to Adrian, Nicolas and Brooks. "... ORDER BY random() LIMIT 10;" works ok. But with the following option it gets more tricky assume: > And as an option the (limited) resultset should be spatially > distributed (not clustered). I'm thinking about some radial spatial distribution