I am trying to clip one table using the features in another. My query is as follows;<br><br><span style="font-style: italic;">drop table bio.bnd_evc;</span><br style="font-style: italic;"><span style="font-style: italic;">
create table bio.bnd_evc as</span><br style="font-style: italic;"><span style="font-style: italic;">select a.buf_dist, b.bio_no, b.bio_code, b.evc, b.constcde, b.consstat, b.density, intersection(a.the_geom, b.the_geom) as the_geom
</span><br style="font-style: italic;"><span style="font-style: italic;">from bio.bnd_buf as a, bio.evc as b</span><br style="font-style: italic;"><span style="font-style: italic;">where a.the_geom && b.the_geom</span>
<br style="font-style: italic;"><span style="font-style: italic;">and a.buf_dist = 1<br>and intersects(a.the_geom, b.the_geom)<br><br></span>Both tables have a GIST index. The query returns a table, however there are several polygons from the evc table, within the bnd_buf table, that are missing. I thought those missing polygons may have had invalid geometries (which is not the case as isvalid(
evc.the_geom) returns TRUE for all geometries) and buffered the evc layer by 0, however this made no difference. One of the missing polygons is completely contained by the selected feature in bnd_buf, but other features that are also completely contained have been selected. The resultant table also shows (in QGIS) polygons where there were no evc polygons.
<br><span style="font-style: italic;"></span><br>I am at a loss to explain what is going on nor how to correct it.<br><br>Thanks in advance,<br><br>Craig Feuerhedt<br><br>