Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SDO_UTIL.FROM_WKTGEOMETRY seems ignorant of ring rotation

Paul DziemielaJan 16 2009 — edited Jan 17 2009
Hello,

Back with more WKT issues. The OGC WKT spec does not enforce any kind of ring rotation on its polygons. However Oracle SDO_GEOMETRY does. When SDO_UTIL.FROM_WKTGEOMETRY converts a WKT polygon it doesn't seem to correct the ring rotation - it just leaves the rings rotated exactly as in the WKT resulting in invalid SDO_GEOMETRY polygons. Wouldn't this be a bug? I can't find anywhere in the SDO_UTIL documentation where we are told to always runs RECTIFY_GEOMETRY after the conversion.

Simple Example:

{color:#008000}SELECT SDO_UTIL.VALIDATE_WKTGEOMETRY('
POLYGON((
-76.57418668270113 38.91891450597657,
-76.57484114170074 38.91758725401061,
-76.57661139965057 38.91881851059802,
-76.57418668270113 38.91891450597657
))') FROM dual
{color}

returns TRUE though ring is clockwise - okay for WKT.

But when we convert it to SDO_GEOMETRY, the ring is still clockwise and throws an error

{color:#008000}SELECT SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(
SDO_GEOMETRY('
POLYGON((
-76.57418668270113 38.91891450597657,
-76.57484114170074 38.91758725401061,
-76.57661139965057 38.91881851059802,
-76.57418668270113 38.91891450597657
))',8265),0.0001) FROM dual
{color}

returns {color:#ff0000}13367 [Element <1>] [Ring <1>]
{color}{color:#000000}

So is this a bug or a feature? Does all WKT polygons coming into Oracle need to have their rings prerotated and if so, why would VALIDATE_WKTGEOMETRY not warn us of the problem.

Cheers,

Paul
{color}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2009
Added on Jan 16 2009
3 comments
3,107 views