Top 5 Recent Articles
ARTICLES CATEGORIES
- Algorithms (22)
- All (399)
- Biography (1)
- Blog (44)
- Business Requirements (1)
- Commentary (1)
- Conversion (2)
- Customers (2)
- Data Models (1)
- Education (2)
- GeoRaptor (13)
- GPS (1)
- Image Processing (2)
- Import Export (8)
- Licensing (2)
- LiDAR (1)
- Linear Referencing (4)
- Manifold GIS (3)
- Mapping (1)
- MySQL Spatial (7)
- Networking and Routing (including Optimization) (5)
- Open Source (18)
- Oracle Spatial and Locator (194)
- Partitioning (1)
- PostGIS (36)
- Projections (1)
- Published Articles (1)
- qGIS (1)
- Recommendations (1)
- Services (1)
- Software Change Log (1)
- Source Code (37)
- Space Curves (9)
- Spatial Database Functions (109)
- Spatial DB comparison (1)
- Spatial XML Processing (11)
- SQL Server Spatial (92)
- Standards (3)
- Stored Procedure (17)
- Tessellation or Gridding (10)
- Tools (2)
- Topological Relationships (1)
- Training (2)
- Triangulation (2)
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT – 13356 Issues
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.
Documentation
- MySQL Spatial General Functions
- Oracle LRS Objects
- Oracle Spatial Exporter (Java + pl/SQL)
- Oracle Spatial Object Functions
- Oracle Spatial Object Functions (Multi Page)
- PostGIS pl/pgSQL Functions
- SC4O Oracle Java Topology Suite (Java + pl/SQL)
- SQL Server Spatial General TSQL Functions
- SQL Server Spatial LRS TSQL Functions