Skip to content

Instantly share code, notes, and snippets.

@hugoledoux
Last active December 23, 2015 17:59
Show Gist options
  • Save hugoledoux/6672756 to your computer and use it in GitHub Desktop.
Save hugoledoux/6672756 to your computer and use it in GitHub Desktop.
GEOS doesn't check the orientation of rings, ie if oring and iring have same orientations then it's still valid
from shapely.wkt import loads
wkt = 'POLYGON((0 0, 10 0, 10 10, 0 10, 0 0), (1 1,3 1, 3 3, 1 1))'
p = loads(wkt)
print p.exterior.is_ccw
print p.interiors[0].is_ccw
print "p valid?", p.is_valid
print p.wkt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment