When data is loaded from external data sources, it is often possible that the spatial data is invalid based on the validation rules in Oracle Spatial. Sometimes these errors are due to variations in how the validation rules are defined between different systems. For example, in Oracle Spatial, polygons should be ordered counter-clockwise for exterior rings and clockwise for interior rings. Such errors can be easily fixed using the utility functions provided by Oracle Spatial. Sometimes these errors are due to inherently bad data that has not been fixed or validated. Such errors are harder to fix, as there might not be a way to fix the geometries without drastically modifying the data. In such cases, users need to manually inspect the data and decide on the appropriate fix.
The SDO_GEOM.Validate_Geometry_With_Context
function gives very specific information about what is wrong with the invalid geometries. The errors associated with the...