Advertisement
brunohaick

Untitled

Apr 10th, 2024
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.39 KB | Source Code | 0 0
  1. SELECT p1.id, SUM(i.area) AS total_area_intersected
  2. FROM your_table_partitioned p1
  3. INNER JOIN (
  4.   SELECT p2.id, SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(p1.geom, SDO_GEOM.SDO_BUFFER(p2.geom, 150))) AS area
  5.   FROM your_table_partitioned p2
  6.   WHERE p1.id <> p2.id
  7.   AND SDO_RELATE(p1.geom, SDO_GEOM.SDO_BUFFER(p2.geom, 150), 'MASK=ANYINTERACT') = 'TRUE'
  8. ) i ON p1.id = i.id
  9. GROUP BY p1.id;
  10.  
Tags: oracle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement