def ring_is_clockwise(ring):
total = <NUM_LIT:0><EOL>for (pt1, pt2) in pairwise(ring):<EOL><INDENT>total += (pt2[<NUM_LIT:0>] - pt1[<NUM_LIT:0>]) * (pt2[<NUM_LIT:1>] + pt1[<NUM_LIT:1>])<EOL><DEDENT>return total >= <NUM_LIT:0><EOL>
Determine if polygon ring coordinates are clockwise. Clockwise signifies
outer ring, counter-clockwise an inner ring or hole. this logic was found
at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order
this code taken from http://esri.github.com/geojson-utils/src/jsonConverters.js by James Cardona (MIT lisense)