Select to view content in your preferred language

Better error messages from ST_GEOMETRY

536
1
06-08-2022 12:00 AM
Status: Open
Bud
by
Esteemed Contributor

SDE.ST_GEOMETRY in Oracle 18c:

If I were to create a polygon geometry from this incorrect WKT (the last vertex is slightly different from the first vertex, which is wrong), I would get the following error in SQL Developer:

select
    sde.st_geometry ('polygon ((676832.320 4857578.086, 665287.423 4857578.086, 665277.423 4878109.585, 
                                676832.320 4878119.585, 676842.320 4857588.086))', 26917)
from
    dual 

ORA-20004:  --Note: I'm not sure why that junk symbol is being returned.
ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 12
ORA-06512: at "SDE.ST_GEOMETRY", line 55

That error message isn't very helpful.

The problem is: the polygon doesn't close properly. But ST_GEOMETRY doesn't say anything to that effect.

Could the ST_GEOMETRY error messages be improved? That would really help when troubleshooting issues.

1 Comment
Bud
by

For example, SDO_GEOMETRY provides a helpful error when validating that geometry:

select
  sdo_geom.validate_geometry_with_context(   
    sdo_geometry ('polygon ((676832.320 4857578.086, 665287.423 4857578.086, 665277.423 4878109.585, 
                676832.320 4878119.585, 676842.320 4857588.086))', 26917)
                  , 0.005)    
from
  dual

Result:
13348 [Element <1>] [Ring <1>]
  • ORA-13348: polygon boundary is not closed
  • Cause: The boundary of a polygon does not close.