SDO_WITHIN_DISTANCE
cptkirkhMay 15 2012 — edited May 17 2012Is there a way to use the SDO_WITHIN_DISTANCE spatial operator and get it to use the spatial index. I read where it says here under section 4.2.1.3 that you can't do a spatial join.
http://docs.oracle.com/cd/B13789_01/appdev.101/b10826/sdo_index_query.htm#i1005386
Then it gives an example on how to perform
CREATE TABLE cosine_bufs UNRECOVERABLE AS
SELECT SDO_BUFFER (A.SHAPE, B.DIMINFO, 1.35)
FROM COSINE A, USER_SDO_GEOM_METADATA B
WHERE TABLE_NAME='COSINES' AND COLUMN_NAME='SHAPE';
then you can run this query..
SELECT a.gid, b.gid FROM parks a, cosine_bufs b, TABLE(SDO_JOIN('PARKS', 'SHAPE', 'COSINE_BUFS', 'SHAPE', 'mask=ANYINTERACT')) c WHERE c.rowid1 = a.rowid AND c.rowid2 = b.rowid;
But from reading this it seems it will not return all items based upon a certain distance. is that correct? Is there a better way to get this information that utilizes the spatial join? I am trying to find all people within a certain distance which is hte best operator to use? Thanks