I have catchment areas as polygons in a GIS layer. They were derived from two different sources (coded as "ws" and "dr" in a separate column named "use"). It's good to have these two sources as they complementing each other. However sometimes they overlap "too much": I want to exclude the "dr"-polygons that overlap (with the "ws" ones) with more than 70% (area). In any way I am want to keep the "ws"-polygons.
If "dr" and "ws" were two different tables I'd query as follows:
SELECT *
FROM table.ws w
JOIN table.dr d ON ST_Intersects(w.geom, d.geom)
WHERE ST_Area(ST_Intersection(w.geom, d.geom) / ST_Area(w.geom) > 0.7;
However in my case ALL the polygons are in the same table only distinguishable by the "use"-column.
Any ideas how to do this? The data lies on a PostgreSQL DB and I access it mostly through PostGIS commands in R.