Friday, October 26, 2018

When SDO_GEOM.SDO_AREA returns a negative value

Always check out the original article at for latest comments, fixes and updates.

If function SDO_GEOM.SDO_AREA returns a negative number chances are that your geometry is invalid.

For instance I checked the geometry with function SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT and it returned:

13349 [Element <1>] [Ring <1>][Edge <2>][Edge <1>]

which means that the polygon boundary crosses itself.
The same applies when code 13356 is returned (adjacent points in a geometry are redundant).

Please note that the absolute value is still correct.
In most cases you should be able to fix the geometry by applying function SDO_GEOM.SDO_SELF_UNION.

This happens on Oracle 12.1

See message translations for ORA-13349, ORA-13356 and search additional resources.

No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles