Skip to content

Instantly share code, notes, and snippets.

@george-silva
Created April 10, 2013 14:51
Show Gist options
  • Save george-silva/5355310 to your computer and use it in GitHub Desktop.
Save george-silva/5355310 to your computer and use it in GitHub Desktop.
Teste de criação interno/externo
>>> p1 = Polygon(((0,0),(0,1),(1,1),(1,0),(0.5,-1),(0,0)))
>>> p2 = Polygon(((0.3,0),(0.6,0),(0.5,-1),(0.3,0)))
>>> p1
<Polygon object at 0x3363e68>
>>> p1.area
1.5
>>> p2.area
0.15000000000000002
>>> p3 = p1.difference(p2)
>>> p3
<Polygon object at 0x3363dc8>
>>> p3.wkt
'POLYGON ((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.5000000000000000 -1.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.5000000000000000 -1.0000000000000000, 0.6000000000000000 0.0000000000000000, 0.3000000000000000 0.0000000000000000, 0.5000000000000000 -1.0000000000000000))'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment