Select Query Uses SDO_UTIL.RECTIFY_GEOMETRY Function Throws ORA-13199: the given geometry cannot be rectified (Doc ID 1638262.1)

Last updated on JULY 27, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.

Symptoms

While running following select query failed with following errors in 12.1 but these query are working fine in 11g:

SELECT SDO_UTIL.RECTIFY_GEOMETRY(geom,0.05) FROM TEST_TABLE;
SELECT SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(SDO_UTIL.RECTIFY_GEOMETRY(geom,0.05),0.05) FROM TEST_TABLE;

ERROR at line 1:
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 803

This is an effect on the improved geodetic geometry validation in 12.1.0.1.
The two geometries that do not rectify (id 15456 and 18710) were categorized as valid in 11g .

In 12c, improved validation now returns:

SELECT id, SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(geom,0.05)
FROM TEST_TABLE
WHERE id in (15456,18710);

15456   13350 [Element <189>] [Ring <1>][Edge <77>] [Element <623>] [Ring <1>][Edge <1>]
18710   13350 [Element <1>] [Rings 1, 53][Edge <1486> in ring <1>][Edge <17> in ring <53>]

In 11g, there was no need to rectify these two geometries because they were valid.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms