Hi Saranya, 2017-02-21 10:51 GMT+01:00 Saranya Kuniyil <saranyak...@gmail.com>:
> Hai, > yes. I am interested to retrieve all polygons which intersects any one > among three categories.. > In the above example, > 1)POLYGON((0 0,0 1,1 1,1 0,0 0)) filename as part1 > POLYGON((0 0,0 2,2 2,2 0,0 0)) filename as part2 > POLYGON((0 0,0 3,3 3,3 0,0 0)) filename as part3 > From these polygons I need to get Intersecting polygon as POLYGON((0 0,0 > 1,1 1,1 0,0 0)), > > 2)POLYGON((0 0,0 3,3 3,3 0,0 0)) filename as part1 > POLYGON((0 0,0 2,2 2,2 0,0 0)) filename as part2 > POLYGON((0 0,0 3,3 3,3 0,0 0)) filename as part3 > From these polygons I need to get Intersecting polygon as POLYGON((0 0,0 > 2,2 2,2 0,0 0)). > > 3)POLYGON((0 0,0 3,3 3,3 0,0 0)) filename as part1 > POLYGON((0 0,0 5,5 5,5 0,0 0)) filename as part2 > POLYGON((0 0,0 4,4 4,4 0,0 0)) filename as part3 > From these polygons I need to get Intersecting polygon as POLYGON((0 0,0 > 3,3 3,3 0,0 0)). > Other combinations also returns same answer. > So, it could be possible that some intersecting geometries (properly referred to different categories) are actually one contained into the other, and so on. You could benefit of the technique reported in this interesting article:: http://postgis.net/2014/03/14/tip_intersection_faster/ to speed up the intersection computation (that is quite expensive in time). I'm asking this because I see you were filtering on overlapping (not just intersecting) geometries through the condition on ST_Overlaps. This one is more restrictive than the ST_Intersects one, so consider to use one or the other basing on what you really need to filter. Hope this can help. Giuseppe. -- Giuseppe Broccolo - 2ndQuadrant Italy PostgreSQL & PostGIS Training, Services and Support giuseppe.brocc...@2ndquadrant.it | www.2ndQuadrant.it
_______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/postgis-users