Bug in function mdsys.sdo_geom.sdo_intersection() ?
475811Dec 4 2006 — edited Dec 5 2006Hi,
I got a strange result from the spatial subprogram
SDO_GEOM.SDO_INTERSECTION(
geom1 IN SDO_GEOMETRY,
dim1 IN SDO_DIM_ARRAY,
geom2 IN SDO_GEOMETRY,
dim2 IN SDO_DIM_ARRAY
) RETURN SDO_GEOMETRY;
I’m calling the function three times, passing each time the same geom1 and geom2 parameters. What changes it the value of the tolerance. Depending on the tolerance, sdo_intersection returns null or a valid geometry
tol = 0.02 --> the resulting geometry is correct
tol = 0.01 --> returns null !
tol = 0.005 --> the resulting geometry is correct
Please note that the result is null only for a tolerance in the range between 0.005 and 0.02 but not below or above these values.
I suppose this is a bug in sdo_intersection.
The exact query is:
select mdsys.sdo_geom.sdo_intersection(
(select A1.geoloc AS G1 from A1 where A1.mi_prinx = 390),
(select m.diminfo AS diminfo_1 from user_sdo_geom_metadata m where m.table_name = 'A1'),
(select A2.geoloc AS G2 from A2 where A2.mi_prinx = 245),
(select m.diminfo AS diminfo_2 from user_sdo_geom_metadata m where m.table_name = 'A2')
)
from dual;
The metadata is changed using this query:
update mdsys.user_sdo_geom_metadata
set diminfo =
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', 650000, 800000, .01),
SDO_DIM_ELEMENT('Y', 180000, 300000, .01))
where table_name IN ( 'A1', 'A2');
Here are the geometries:
geom1:
SDO_GEOMETRY(2003, 262148, SDO_POINT_TYPE(758105.191, 245133.936, NULL), SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(758052.231, 245053.334, 758069.068, 245067.151, 758086.21, 245078.671, 758103.848, 245088.516, 758129.333, 245101.44, 758233.145, 245178.636, 758224.249, 245202.49, 758201.602, 245194.226, 758194.164, 245214.538, 758096.977, 245178.816, 758091.076, 245194.648, 758026.177, 245181.097, 758008.793, 245172.515, 757977.236, 245143.726, 758052.231, 245053.334))
geom2:
SDO_GEOMETRY(2003, 262148, SDO_POINT_TYPE(758042.484, 245106.878, NULL), SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(758129.32, 245101.47, 758233.14, 245178.66, 758224.242, 245202.514, 758211.122, 245237.717, 758166.209, 245208.415, 758091.065, 245194.675, 758026.168, 245181.127, 758008.785, 245172.546, 757977.231, 245143.76, 757932.238, 245109.93, 757895.471, 245068.865, 757851.827, 245034.324, 757941.369, 244976.447, 757951, 244976.04, 757960.491, 244979.747, 757992.773, 244998.626, 758005.407, 245007.133, 758026.492, 245029.014, 758052.22, 245053.37, 758069.056, 245067.186, 758086.197, 245078.704, 758103.835, 245088.548, 758129.32, 245101.47))