Polygon rings can have two different orientations: clockwise and
counterclockwise. In a clockwise oriented polygon the polygon lies to the
right as you traverse the boundary in order, while the reverse is true for
a counterclockwise oriented polygon. Both orientations are basically valide
representations of a polygon but many algorithms assumes a certain
orientation of the boundary and holes in order to work. The outer boundary
must be counterclockwise and all holes must be clockwise. This will ensure
that the polygon always lies to the left as you traverse all the borders of
the polygon. reverse_orientation()
reverses the orientation of both the
outer boundary and the holes. is_clockwise()
and is_counterclockwise()
only reports the orientation of the outer boundary. To get the orientation
of a hole, first extract it with hole()
.