I'm trying to use ST_difference and ST_intersection with two layers of multipolygons.
I want something like:
With the input on the left and the result on the right.
MY DATA:
t1.geom contains 1000 differents polygons.
t2.geom contains 1000 differents polygons.
THE QUERIES:
I try to create (in a naive way) two queries to perform these operations
st_intersection(t1.geom, t2.geom)
from t1,t2
where st_intersects(t1.geom,t2.geom);
Unfortunately it doesn't work, or takes forever to run.
I would like a query similar to the tools erase
and intersect
from ArcGIS.
QUESTION:
How to perform those operations efficiently ?
st_difference(t1.geom, t2.geom) from t1,t2 where st_intersects(t1.geom,t2.geom);
t1.geom - t2.geom
, in fact i don't understand the result, i just want to erase t2.geom that overlaps t1.geom