Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SDO_RELATE and SDO_BUFFER

450184Sep 5 2010 — edited Sep 6 2010
Hi Folks,

I created a generic stored procedure that gets a table and a polygon coordinates as parameters and returns
the table records that satisfy a relationship.
One example of fhe SQL executed by the procedure is:

select GEOFT_MESORREGIAO.* from GEOFT_MESORREGIAO
where SDO_RELATE(GEOFT_MESORREGIAO.MES_GM_POLIGONO,
SDO_GEOMETRY(2003,2000004,NULL,
SDO_ELEM_INFO_ARRAY(1,1003,1),
SDO_ORDINATE_ARRAY(-51.427259,-20.547785,-51.575114,-22.289193,-49.094429,-22.387763,-49.028716,-20.457420)),'mask=ANYINTERACT') ='TRUE'

The GEOFT_MESORREGIAO stores polygon geometries.
Running the example I got 7 rows as result.

In the same procedure, users can pass additional parameters to create a buffer around the polygon defined as the query window.
In this case, the SQL executed is:

select GEOFT_MESORREGIAO.* from GEOFT_MESORREGIAO
where SDO_RELATE(GEOFT_MESORREGIAO.MES_GM_POLIGONO,
SDO_GEOM.SDO_BUFFER(SDO_GEOMETRY(2003,2000004,NULL,
SDO_ELEM_INFO_ARRAY(1,1003,1),
SDO_ORDINATE_ARRAY(-51.427259,-20.547785,-51.575114,-22.289193,-49.094429,-22.387763,-49.028716,-20.457420)),10,0.05,'unit=KM'),'mask=ANYINTERACT') ='TRUE'

Running this example I got 6 rows as result.
This is not right to me, because if I'm using a bigger query window created by the buffer function, it was expected to get more rows
as result or, at least, the same number of rows returned by the first example.

This was tested in Oracle 11g R1.

Am I missing anything?

Regards,

Luis
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2010
Added on Sep 5 2010
2 comments
1,078 views