Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometries stored in Oracle table fail sdo_geom.validate_geometry_with_context(..) check #29085

Closed
qgib opened this issue Feb 14, 2019 · 0 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@qgib
Copy link
Contributor

qgib commented Feb 14, 2019

Author Name: Steve Pritchard (@spritchard)
Original Redmine Issue: 21267
Affected QGIS version: 3.4.4
Redmine category:data_provider/oracle
Assignee: Jürgen Fischer


The geometries that QGIS writes to Oracle are often "invalid" according to Oracle Spatial - sdo_geom.validate_geometry_with_context(..) returns an error code:

ORA-13367: wrong orientation for interior/exterior rings

Cause:
In an Oracle Spatial geometry, the exterior and/or interior rings are not oriented correctly.

Action:
Be sure that the exterior rings are oriented counterclockwise and the interior rings are oriented clockwise.

If the vertices of a simple polygon are drawn in an anticlockwise order, then Oracle regards the geometry as valid.
But if the vertices as drawn in a clockwise order, sdo_geom.validate_geometry_with_context(...) returns 13367.
Also if I start with a polygon that is valid in Oracle and then split it in QGIS, I end up with two polygons that are both invalid (13367).

This problem doesn't appear to have been reported before, which suggests that it doesn't cause problems within QGIS. However, if you are preparing data in QGIS that is then going to be used within an Oracle Spatial application, then the invalid geometries can cause Oracle Spatial functions/operators to fail or return incorrect results.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@rouault rouault self-assigned this Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

2 participants