# [geos-devel] [GEOS] #665: st_isvalid fails to detect invalid interior ring orientation

GEOS geos-trac at osgeo.org
Thu Sep 26 05:13:39 PDT 2013

```#665: st_isvalid fails to detect invalid interior ring orientation
------------------------+---------------------------------------------------
Reporter:  vmo         |       Owner:  geos-devel@…
Type:  defect      |      Status:  new
Priority:  major       |   Milestone:  3.4.3
Component:  Default     |     Version:  3.3.3
Severity:  Unassigned  |    Keywords:
------------------------+---------------------------------------------------

Comment(by vmo):

I agree that the orientation of the exterior ring is not specified (it's
used to define the top, nothing more).

But to me the highlighted sentence clearly says that interior rings must
be oriented opposite to the exterior ring.

It's somewhat clarified in the draft of the upcoming ISO 19107 (admittedly
not voted yet):

''"Surfaces in 2D will always have a planar interpolation because of the
restriction of the dimension of the coordinate space. In 2D because of the
restriction above, a surface will have a unique exterior ring, the one
with the largest envelope, and some number of interior rings. Each such
ring in 2D satisfies the Jordan Curve Theorem and thus divides the space
into exactly two regions, one bounded and one unbounded. For rings that
are counterclockwise, the bounded area is to the left of the ring as a
curve. For rings that are clockwise, the bounded area is to its right.
'''Each ring is said to define an area, the one to its left'''. A surface
in 2D is the set intersection of the areas defined by its rings."''

I say "somewhat clarified" because the highlighted sentence means that
orientation defines where the area is (exterior or interior). Interior
ring needs to define the unbounded region to define the polygon as
intersection of all areas defined by the rings. Nevertheless, the two
previous sentences seem to me to say just the opposite.

--
Ticket URL: <http://trac.osgeo.org/geos/ticket/665#comment:5>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
```