Hi,<br><br>I'm curious if anyone can quickly see what I may be doing wrong here. I'm trying to restrict a query such that the geometry falls within a specified BBOX. Basic PostGIS stuff....right?<br><br>However, for the following query, I'm not expecting to get any results, as the bbox specified has no points lying within it. And yet I get the result below.
<br><br>BOX3D is specified as (xmin ymin, xmax ymax) right?<br><br>So here's the query:<br><br> SELECT AsText(the_geom) AS the_geom, FACILITY_N, OBJECTID, FACILITY_I, DEPTNAME FROM poi_2 WHERE lower(FACILITY_N) LIKE '%lafa%' OR lower(OBJECTID) LIKE '%lafa%' OR lower(FACILITY_I) LIKE '%lafa%' OR lower(DEPTNAME) LIKE '%lafa%' AND the_geom && SetSRID('BOX3D(-
121.00 38.000, -119.00 40.00)'::box3d,4326);<br>        the_geom         |        facility_n        | objectid | facility_i |              deptname              <br>-------------------------+--------------------------+----------+------------+------------------------------------
<br> POINT(-122.497 37.7771) | LAFAYETTE SCHOOL (ELEM.) | 1969     | 0000003158 | SF Unified School District (SFUSD)<br><br>Here's the table description:<br><br>\d poi_2;<br>           Table "public.poi_2"<br>
   Column   |       Type        | Modifiers <br>------------+-------------------+-----------<br> facility_n | character varying | <br> objectid   | character varying | <br> facility_i | character varying | <br> deptname   | character varying | 
<br> the_geom   | geometry          | <br>Indexes:<br>    "deptname_gepoi_2_idx" btree (lower(deptname::text))<br>    "facility_i_gepoi_2_idx" btree (lower(facility_i::text))<br>    "facility_n_gepoi_2_idx" btree (lower(facility_n::text))
<br>    "objectid_gepoi_2_idx" btree (lower(objectid::text))<br>    "the_geom_gepoi_2_idx" gist (the_geom)<br>Check constraints:<br>    "enforce_dims_the_geom" CHECK (ndims(the_geom) = 2)<br>
    "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL)<br>    "enforce_srid_the_geom" CHECK (srid(the_geom) = 4326)<br><br>Any ideas?<br>Cheers,<br>Dylan
<br>