Hi,<br><br>I&#39;m curious if anyone can quickly see what I may be doing wrong here. I&#39;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&#39;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&#39;s the query:<br><br>&nbsp;SELECT AsText(the_geom) AS the_geom, FACILITY_N, OBJECTID, FACILITY_I, DEPTNAME FROM poi_2 WHERE lower(FACILITY_N) LIKE &#39;%lafa%&#39; OR lower(OBJECTID) LIKE &#39;%lafa%&#39; OR lower(FACILITY_I) LIKE &#39;%lafa%&#39; OR lower(DEPTNAME) LIKE &#39;%lafa%&#39; AND the_geom &amp;&amp; SetSRID(&#39;BOX3D(-
121.00 38.000, -119.00 40.00)&#39;::box3d,4326);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the_geom&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; facility_n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | objectid | facility_i |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deptname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>-------------------------+--------------------------+----------+------------+------------------------------------
<br>&nbsp;POINT(-122.497 37.7771) | LAFAYETTE SCHOOL (ELEM.) | 1969&nbsp;&nbsp;&nbsp;&nbsp; | 0000003158 | SF Unified School District (SFUSD)<br><br>Here&#39;s the table description:<br><br>\d poi_2;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Table &quot;public.poi_2&quot;<br>
&nbsp;&nbsp; Column&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Modifiers <br>------------+-------------------+-----------<br>&nbsp;facility_n | character varying | <br>&nbsp;objectid&nbsp;&nbsp; | character varying | <br>&nbsp;facility_i | character varying | <br>&nbsp;deptname&nbsp;&nbsp; | character varying | 
<br>&nbsp;the_geom&nbsp;&nbsp; | geometry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | <br>Indexes:<br>&nbsp;&nbsp;&nbsp; &quot;deptname_gepoi_2_idx&quot; btree (lower(deptname::text))<br>&nbsp;&nbsp;&nbsp; &quot;facility_i_gepoi_2_idx&quot; btree (lower(facility_i::text))<br>&nbsp;&nbsp;&nbsp; &quot;facility_n_gepoi_2_idx&quot; btree (lower(facility_n::text))
<br>&nbsp;&nbsp;&nbsp; &quot;objectid_gepoi_2_idx&quot; btree (lower(objectid::text))<br>&nbsp;&nbsp;&nbsp; &quot;the_geom_gepoi_2_idx&quot; gist (the_geom)<br>Check constraints:<br>&nbsp;&nbsp;&nbsp; &quot;enforce_dims_the_geom&quot; CHECK (ndims(the_geom) = 2)<br>
&nbsp;&nbsp;&nbsp; &quot;enforce_geotype_the_geom&quot; CHECK (geometrytype(the_geom) = &#39;POINT&#39;::text OR the_geom IS NULL)<br>&nbsp;&nbsp;&nbsp; &quot;enforce_srid_the_geom&quot; CHECK (srid(the_geom) = 4326)<br><br>Any ideas?<br>Cheers,<br>Dylan
<br>