sdo_util.simplify - Error? Bug? Totally stumped !
883763Nov 4 2011 — edited Nov 7 2011Hi folks,
I have a confusing problem/error with using sdo_util.simplify. I am using Oracle 11G R2 with Spatial Option.
I have loaded just over 2000 UK postown polygons - based on an OS source. These loaded fine and have been working perfectly well with spatial sql.
The source data specifies the projection as British National Grid GCS_OSGB_1936 and the SRID within the Oracle metadata was correctly (i believe) determined (by calculate mbr) and set to 7405 - OSGB36 / British National Grid
I can view the polygons perfectly fine in SqlDeveloper/GeoRaptor and if export them to KML and view them in Google Earth they position and display exactly as I would expect.
All other spatial functions I have tried on the polygons work fine.
The problem comes when I try and use sdo_util.simplify to reduce the number of co-ordinates used on the polygons :
select sdo_util.simplify(poly_hi,100,0.005)
from posttown_boundaries;
ORA-13199: the given geometry cannot be rectified
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 17
ORA-06512: at "MDSYS.SDO_UTIL", line 716
ORA-06512: at "MDSYS.SDO_UTIL", line 770
ORA-06512: at line 1
13199. 00000 - "%s"
*Cause: This is an internal error.
*Action: Contact Oracle Support Services.
I've tried various threshold and tolerance values ( the only threshold value that works is 0 which returns the same geometry.
I have successfully used the sdo_util.simpify functions on the other spatial objects in the database so I don't believe it to be a database setup issue.
When I run a validate geometry on the table for the geometry column I get the ORA-13029: Invalid SRID in the SDO_GEOMETRY object.
However, as explained above the SRID was selected and checked using calculate MBR and it matches exactly what I would have expected given the source data and i have not found any other issues with the SRID.
The error can be reproduced without any of the source tables by just taking one small polygon definition as follows:
select sdo_util.simplify(
MDSYS.SDO_GEOMETRY(
2003,7405,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),
MDSYS.SDO_ORDINATE_ARRAY(407207.997315803,287087.001455892,
406802.999914517,286916.000404434,
406677.996543163,286831.004734191,
406518.001132497,286741.000497636,
406863.996876543,286566.000590838,
407284.000289033,286672.000248752,
407207.997315803,287087.001455892))
,5,0.005)
FROM dual;
ORA-13199: the given geometry cannot be rectified
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 17
ORA-06512: at "MDSYS.SDO_UTIL", line 716
ORA-06512: at "MDSYS.SDO_UTIL", line 770
ORA-06512: at line 1
13199. 00000 - "%s"
*Cause: This is an internal error.
*Action: Contact Oracle Support Services.
Am totally stumped with this!
Can anyone offer any thoughts or guidance?
Many thanks in advance.
Mike.