<div dir="ltr">Hi Saranya,<br><div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-21 10:51 GMT+01:00 Saranya Kuniyil <span dir="ltr"><<a href="mailto:saranyak578@gmail.com" target="_blank">saranyak578@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hai,<br></div>yes. I am interested to retrieve all polygons which intersects any one among three categories.. <br></div>In the above example,<br>1)POLYGON((0 0,0 1,1 1,1 0,0 0))   filename as part1<span class="gmail-"><br>POLYGON((0 0,0 2,2 2,2 0,0 0))   filename as part2<br></span><span class="gmail-">POLYGON((0 0,0 3,3 3,3 0,0 0))   filename as part3<br></span></div>From these polygons I need to get Intersecting polygon as POLYGON((0 0,0 1,1 1,1 0,0 0)),<br><br>2)POLYGON((0 0,0 3,3 3,3 0,0 0))    filename as part1<span class="gmail-"><br>POLYGON((0 0,0 2,2 2,2 0,0 0))   filename as part2<br></span><span class="gmail-">POLYGON((0 0,0 3,3 3,3 0,0 0))   filename as part3<br></span>From these polygons I need to get Intersecting polygon as POLYGON((0 0,0 2,2 2,2 0,0 0)).<br><br>3)POLYGON((0 0,0 3,3 3,3 0,0 0))    filename as part1<span class="gmail-"><br>POLYGON((0 0,0 5,5 5,5 0,0 0))   filename as part2<br></span><span class="gmail-">POLYGON((0 0,0 4,4 4,4 0,0 0))   filename as part3<br></span>From these polygons I need to get Intersecting polygon as POLYGON((0 0,0 3,3 3,3 0,0 0)).<br></div>Other combinations also returns same answer.<br></div></div></blockquote><div><br></div><div>So, it could be possible that some intersecting geometries (properly referred to different categories) are<br></div><div>actually one contained into the other, and so on. You could benefit of the technique reported in this interesting <br>article::<br></div><div><br><a href="http://postgis.net/2014/03/14/tip_intersection_faster/">http://postgis.net/2014/03/14/tip_intersection_faster/</a></div></div><br></div><div class="gmail_extra">to speed up the intersection computation (that is quite expensive in time). I'm asking this because I see you were<br></div><div class="gmail_extra">filtering on overlapping (not just intersecting) geometries through the condition on ST_Overlaps. This one is more<br></div><div class="gmail_extra">restrictive than the ST_Intersects one, so consider to use one or the other basing on what you really need to filter.<br><br></div><div class="gmail_extra">Hope this can help.<br><br></div><div class="gmail_extra">Giuseppe. <br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span></span>Giuseppe Broccolo - 2ndQuadrant Italy
<br>PostgreSQL & PostGIS Training, Services and Support
<br><a href="mailto:giuseppe.broccolo@2ndQuadrant.it" target="_blank">giuseppe.broccolo@2ndQuadrant.it</a> | <a href="http://www.2ndQuadrant.it" target="_blank">www.2ndQuadrant.it</a>
</div></div></div></div>
</div></div></div>