<html><body><div style="color:#000; background-color:#fff; font-family:garamond, new york, times, serif;font-size:14px"><div id="yui_3_16_0_1_1416243138622_222098">Hello, I'm trying to perform a query which will return any polygons which have any points in common with an input polygon.</div><div id="yui_3_16_0_1_1416243138622_222099"><br></div><div id="yui_3_16_0_1_1416243138622_222100" dir="ltr">So, if I have Polygon A.</div><div id="yui_3_16_0_1_1416243138622_222101" dir="ltr">In my database, I have several other polygons stored.</div><div id="yui_3_16_0_1_1416243138622_222102" dir="ltr"><br></div><div id="yui_3_16_0_1_1416243138622_222103" dir="ltr">I want to submit a query with Polygon A as the input, which will return all of the polygons in my database which have any points in common with Polygon A.</div><div id="yui_3_16_0_1_1416243138622_222104" dir="ltr"><br></div><div id="yui_3_16_0_1_1416243138622_222105" dir="ltr">Can this be done?</div><div id="yui_3_16_0_1_1416243138622_222106" dir="ltr"><br>I found this:</div><div id="yui_3_16_0_1_1416243138622_222080" dir="ltr"><a id="yui_3_16_0_1_1416243138622_222079" href="http://postgis.net/docs/ST_Overlaps.html">http://postgis.net/docs/ST_Overlaps.html</a><br></div><div id="yui_3_16_0_1_1416243138622_222062"><br><span></span></div><div id="yui_3_16_0_1_1416243138622_222197" dir="ltr"><span id="yui_3_16_0_1_1416243138622_222196">But from what I can tell, it only returns a T or F. I need to fetch the actual polygons if T.</span></div><div id="yui_3_16_0_1_1416243138622_222122" dir="ltr"><br><span></span></div><div id="yui_3_16_0_1_1416243138622_222123" dir="ltr"><span id="yui_3_16_0_1_1416243138622_222199">I'm currently able to query with points as input:</span></div><div id="yui_3_16_0_1_1416243138622_222182" dir="ltr"><br><span></span></div><div id="yui_3_16_0_1_1416243138622_222184" dir="ltr"><span id="yui_3_16_0_1_1416243138622_222187">select zone,gid,state,name,ST_Asgeojson( geom ) from polys where ST_Intersects(ST_PointFromText('POINT(-109 42)', 4269), geom);</span></div><div id="yui_3_16_0_1_1416243138622_222188" dir="ltr"><br><span id="yui_3_16_0_1_1416243138622_222187"></span></div><div id="yui_3_16_0_1_1416243138622_222189" dir="ltr"><span id="yui_3_16_0_1_1416243138622_222187">But now I have a need to use polygons as input.</span></div><div id="yui_3_16_0_1_1416243138622_222190" dir="ltr"><br><span id="yui_3_16_0_1_1416243138622_222187"></span></div><div id="yui_3_16_0_1_1416243138622_222191" dir="ltr"><span id="yui_3_16_0_1_1416243138622_222187">Any help would be great.</span></div><div id="yui_3_16_0_1_1416243138622_222192" dir="ltr"><br><span id="yui_3_16_0_1_1416243138622_222187"></span></div><div id="yui_3_16_0_1_1416243138622_222193" dir="ltr"><span id="yui_3_16_0_1_1416243138622_222187">Thanks!</span></div><div id="yui_3_16_0_1_1416243138622_222195"><br></div><div id="yui_3_16_0_1_1416243138622_222329">Regards,</div><div id="yui_3_16_0_1_1416243138622_222336" dir="ltr">Joseph Spenner</div><div id="yui_3_16_0_1_1416243138622_222368" dir="ltr"><br></div><br><div id="yui_3_16_0_1_1416243138622_222127" style="font-family: garamond, new york, times, serif; font-size: 14px;"><div id="yui_3_16_0_1_1416243138622_222126" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> </div> </div> </div></body></html>