Home » Server Options » Spatial » Overlapping polygon and how to determine the points (10G R/2)
Overlapping polygon and how to determine the points [message #341217] Sun, 17 August 2008 21:15
TJPokala
Messages: 17
Registered: March 2008
Junior Member
Hi All,

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';

add_log(proc_name,'Start processingpolyA');

COMMIT;

FOR x IN (SELECT id, geoloc FROM A)

LOOP

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);
END IF;
END LOOP;
COMMIT;
END LOOP;
add_log(proc_name,'Finish!');
COMMIT;
EXCEPTION
WHEN OTHERS THEN
add_log(proc_name, substr(SQLCODE||' '||SQLERRM, 1, 199));

COMMIT;


Do the same for B then


select ID from A,B where sdo_relate(A.geoloc,B.geoloc,'mask = contains') = 'TRUE';

Any Ideas...?
Previous Topic: Problem with cursors
Next Topic: SDO_GEOMETRY & ODP.NET
Goto Forum:
  


Current Time: Sun Dec 21 07:20:08 CST 2014

Total time taken to generate the page: 0.04515 seconds