[postgis-users] geos based spatial queries

David Blasby dblasby at refractions.net
Thu Nov 20 11:37:57 PST 2003


Peter Aberline wrote:

> select count(*)
> from points
> where within(points.the_geom, (select the_geom
>                                                               from states
>                                                               where
> state_name = 'BigState')) = true;

try:


SELECT count(*) FROM points WHERE
  within(points.the_geom, (select the_geom from states   where 
state_name = 'BigState')  AND
points.the_geom && (select the_geom from states   where  state_name = 
'BigState')




More information about the postgis-users mailing list