4 Replies Latest reply: Jan 7, 2014 7:12 AM by Jyothsna-Oracle RSS

    Checking polygon overlap

    Jyothsna-Oracle

      I need to determine whether a polygon overlaps with another. Here polygon can be of shape circle, rectangle, postal code or polygon.

       

      Overlap can be anything other than TOUCH, Can I use multiple masks as mentioned in below query?

       

      SELECT COUNT(*) AS OVERLAP_COUNT

      FROM M1_POLYGON a ,

        (SELECT M1_POLYGON_GEOMETRY

        FROM M1_POLYGON

        WHERE ENTITY_KEY1 <> 'ZZSA2'

        AND ENTITY_KEY1   IN

          (SELECT DISTINCT SVC_AREA_CD

          FROM M1_SVC_AREA

          WHERE M1_SVC_TYPE_FLG = 'ZZSA'

          )

        ) b

      WHERE a.M1_ENTITY_TYPE_FLG= 'M1SA'

      AND a.ENTITY_KEY1 = 'ZZSA2'

      AND SDO_RELATE(a.M1_POLYGON_GEOMETRY, b.M1_POLYGON_GEOMETRY,'mask=OVERLAPBDYINTERSECT+CONTAINS+COVERS+COVEREDBY+EQUAL') = 'TRUE'