Must be a fairly trivial task, but PostGIS gives me errors..
I have a set of geometries
geom in a single table
t1, and I would like to find intersection area of all of the rows
foo where value is
What I am doing is:
SELECT ST_INTERSECTION(geom) FROM t1 WHERE foo = 'bar' and ST_INTERSECTS(geom)
I understand examples where I have two geometries or two tables, but I can't figure out how to do that in a single table across rows. I have several thousands records to filter, so specifying geometries explicitly is not an option.
And yet I am not getting the results I expect from
St_intersection (yeah, I assume not the method's fault):
If I apply the method as described above I will get an intersection between each and every row in the table. It's easier to see what I mean, check the picture below.
Instead of having a single geometry (polygon) which represents the shared area between all geometries I get multiple geometries. I am still wondering how to get the area shared by all geometries, not a set of intersections for all pairs in the table.