<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">using postgresql 8.3.4<br>using postgis 1.3.3<br>using geos 3.0.0<br>using proj 4.6.1<br><br>I'm encountering a couple of oddities which I'm pretty sure are related.<br><br>I have US Census Congressional districts modeled in PostGIS.<br><br>I've got a simple php program that uses ST_Within( ) to check a lat,lon against the congressional district polygons.  A small number of the districts are causing the query to return zero records incorrectly.<br><br>I've also got a simple php-mapscript with a LAYER to simply display all of these congressional districts.  When zoomed out around 1:400k and further out, these peculiar districts appear along side their neighbors.  When I zoom in closer, these same districts stop appearing.<br><br>I'm pretty sure this is a problem with the spatial indexes, which were created by shp2pgsql, because I converted the
 search program from ST_Within( ) to _ST_Within( ), which is advertised as skipping the indexing.  _ST_Within( ) is a bit slower, but finds these districts ok.<br><br>I've run VACUUM ANALYZE on the table, but this hasn't changed anything.<br><br>I haven't dug into the mapserver pg driver to see if there is any way for me to manipulate the generated query into skipping indexes.<br><br>I haven't yet dug into the records further to see if they have pathological bboxes or similar.<br><br>There are no holes in these polygons.<br><br>Anyone have any ideas on this?<br><br>thanks,<br>Robert H.<br></td></tr></table>