Go to content Go to navigation and search

Home

Current Oracle Spatial Blog Articles


Search

Browse

RSS / Atom

Email me

textpattern

Creative Commons License
All Blog Articles, Data Models and Free Source Code by Simon Greener, The SpatialDB Advisor is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT - 13356 Issues

Sunday May 15 2011 at 07:32

I have been doing a lot of work recently with processing the errors reported by Oracle’s MDSYS.SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT function.

The results that are output from this function are not well documented with some outputs only being discovered by having bad geometries that generate those errors!

But it was interesting for me to note that the function only ever reports the first duplicate vertex of a geometry when the error is 13356.

Here are some examples (using simple linestrings – 2002 – and multilinestrings – 2006) you can try yourself:

-- Single duplicate in single linestring
select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(2002, NULL, NULL, 
       MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1), MDSYS.SDO_ORDINATE_ARRAY(50.0, 15.0, 55.0, 15.0, 55.0, 15.0, 15.0, 60.0)),0.005) as contextError 
  from dual;
 
 
CONTEXTERROR
------------
13356 [Element <1>] [Coordinate <2>]
 
 
-- Multiple duplicates in single linestring
select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(2002, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1), 
       MDSYS.SDO_ORDINATE_ARRAY(50.0, 15.0, 55.0, 15.0, 55.0, 15.0, 55.0, 15.0, 60.0, 15.0)),0.005) as contextError 
  from dual;
 
 
CONTEXTERROR
------------
13356 [Element <1>] [Coordinate <2>]
 
 
-- Two duplicates in first element, single duplicate in second of multilinestring
select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(2006, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1,7,2,1), 
       MDSYS.SDO_ORDINATE_ARRAY(50.0, 15.0, 55.0, 15.0, 55.0, 15.0, 60.0, 15.0, 60.0, 15.0, 65.0, 15.0)),0.005) as contextError 
  from dual;
 
 
CONTEXTERROR
------------
13356 [Element <1>] [Coordinate <2>]
 
 
-- No duplicates in first element, single duplicate in second of multilinestring
select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(2006, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1,5,2,1), 
       MDSYS.SDO_ORDINATE_ARRAY(50.0, 15.0, 55.0, 15.0, 60.0, 15.0, 60.0, 15.0, 65.0, 15.0)),0.005) as contextError 
  from dual;
 
 
CONTEXTERROR
------------
13356 [Element <2>] [Coordinate <1>]
 
 
-- Triple duplicate in first element, single duplicate in second of multilinestring
select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(2006, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1,9,2,1), 
       MDSYS.SDO_ORDINATE_ARRAY(50.0, 15.0, 55.0, 15.0, 55.0, 15.0, 55.0, 15.0, 60.0, 15.0, 60.0, 15.0, 65.0, 15.0)),0.005) as contextError 
  from dual;
 
 
CONTEXTERROR
------------
13356 [Element <1>] [Coordinate <2>]

I would have expected that all duplicate points would have been reported.

Oracle should fix this, of course, but in the meantime, if I get time, I will write a function that reports all duplicate points.

I hope this is of help to someone.

Creative Commons License

post this at del.icio.uspost this at Diggpost this at Technoratipost this at Redditpost this at Farkpost this at Yahoo! my webpost this at Windows Livepost this at Google Bookmarkspost this to Twitter

Comment