1

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.

andschar
  • 1,255
  • 10
  • 13
  • I'd say it's a different questions because the one you are referring to uses two tables. All my information is in one table though. – andschar Jun 13 '16 at 16:38
  • Don't forget to take the 2-minute [Tour] which is designed to introduce all users of the site to its philosophies and protocols. If you think this should not be a duplicate then you are far better to use the [edit] button beneath your question to make the distinction clearer. – PolyGeo Oct 01 '16 at 22:20

0 Answers0