Bizarre SDO_UNION error - anyone with 11g handy?
Hi folks,
I have two reasonable polygons (I think) that will not union in 10g. The overlap partly but that should not be an issue I think. I've tested with both 10.2.0.3 and 10.2.0.1 and the same thing happens. In fact they seem to negate each almost as if the union flips into a difference behind the scenes.
If anyone has 11g handy, could you compile the small function below and see if you get a union?
select union_error2('WI') from dual gives polygon 1
select union_error2('MN') from dual gives polygon 2
select union_error from dual should give the union but returns nothing.
Thanks for any help. I've heard all these vicious rumors that bug fixes won't be back-ported to 10g2, I hope thats not true.
Cheers,
Paul
CREATE OR REPLACE FUNCTION UNION_ERROR2 (
p_input VARCHAR2 DEFAULT NULL
) RETURN SDO_GEOMETRY
AS
sdo_wi SDO_GEOMETRY;
sdo_mn SDO_GEOMETRY;
BEGIN
sdo_wi := SDO_GEOMETRY
(
2003,
8265,
NULL,
SDO_ELEM_INFO_ARRAY
(
1,
1003,
1
),
SDO_ORDINATE_ARRAY
(
-91.671499948515,
44.0902015774749,
-91.6715115503426,
44.0902015774749,
-91.6715015346985,
44.090194195845,
-91.6714999485278,
44.0901930561382,
-91.671499948515,
44.0902015774749
)
);
sdo_mn := SDO_GEOMETRY
(
2003,
8265,
NULL,
SDO_ELEM_INFO_ARRAY
(
1,
1003,
1
),
SDO_ORDINATE_ARRAY
(
-91.6715103295238,
44.0901866406186,
-91.6714955476043,
44.0901866406186,
-91.6714955474299,
44.0901898868289,
-91.6715013111811,
44.0901940282069,
-91.671501758216,
44.090194363483,
-91.6715103292778,
44.0902005223217,
-91.6715103295238,
44.0901866406186
)
);
IF UPPER(p_input) = 'WI'
THEN
RETURN sdo_wi;
ELSIF UPPER(p_input) = 'MN'
THEN
RETURN sdo_mn;
ELSE
RETURN SDO_GEOM.SDO_UNION(sdo_wi,sdo_mn,0.05);
END IF;
END UNION_ERROR2;