best way to performance an spatial join
What is the best way to performance an spatial join with two tables. Of course these two tables has spatial indexes to their sdo_geometry columnsI manage two situations:
A) with specific features.
Compare all features of the one layer to all features to the other layer.
A.- For the first situation I think the best way is ussing the sdo_relate command. Here is an example:
SELECT COUNT(*) FROM
(select /*+ ordered */ Q1.gid , Q2.gid , SDO_GEOM.SDO_AREA( SDO_GEOM.SDO_INTERSECTION(q1.geometry,q2.geometry,0.5) , 0.5 ) as area from
(select gid,geometry from TABLE_1 ) Q1 ,
(select gid,geometry from TABLE_2) Q2
A) with specific features.
Compare all features of the one layer to all features to the other layer.
A.- For the first situation I think the best way is ussing the sdo_relate command. Here is an example:
SELECT COUNT(*) FROM
(select /*+ ordered */ Q1.gid , Q2.gid , SDO_GEOM.SDO_AREA( SDO_GEOM.SDO_INTERSECTION(q1.geometry,q2.geometry,0.5) , 0.5 ) as area from
(select gid,geometry from TABLE_1 ) Q1 ,
(select gid,geometry from TABLE_2) Q2
0