|Overlapping polygon and how to determine the points [message #341217]
||Sun, 17 August 2008 21:15
Registered: March 2008
I have a larger footprint polygon/table called A and a sub-polygon/table called B.
I need to identify which is polygon A and which is polygon B because they overlap with each other.
And I need to identify all the point that falls within A and B.
which means A = A and B = A+B and the other points that do notfall within A and B will be null.
How do I start this assignment?
I was thinking
alter table A
add (ID varchar( 50 BYTE)) ;update Aset ID = 'larger';
-------------TO do a point in Polygon-------
PROCEDURE point_polyAIS proc_name varchar2(50);
BEGIN proc_name := 'point_polyA';
FOR x IN (SELECT id, geoloc FROM A)
FOR y IN (SELECT a.* FROM point
WHERE sdo_filter (A.geoloc, x.geoloc) = 'TRUE')
LOOP IF sdo_geom.relate(y.geoloc, 'ANYINTERACT', x.geoloc, 5) = 'TRUE'
THEN INSERT INTO point_polyA ( id) VALUES ( x.id);
WHEN OTHERS THEN
add_log(proc_name, substr(SQLCODE||' '||SQLERRM, 1, 199));
Do the same for B then
select ID from A,B where sdo_relate(A.geoloc,B.geoloc,'mask = contains') = 'TRUE';