#NEWLINE# def test_simple_polygon_w_hole( self ) : #NEWLINE# #INDENT# w1 = Way ( 1 , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ 1 , 2 , 3 , 4 , 1 ] ) #NEWLINE# w1 . coords = [ ( 0 , 0 ) , ( 10 , 0 ) , ( 10 , 10 ) , ( 0 , 10 ) , ( 0 , 0 ) ] #NEWLINE# w2 = Way ( 2 , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ 5 , 6 , 7 , 8 , 5 ] ) #NEWLINE# w2 . coords = [ ( 2 , 2 ) , ( 8 , 2 ) , ( 8 , 8 ) , ( 2 , 8 ) , ( 2 , 2 ) ] #NEWLINE# r = Relation ( 1 , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ ( 1 , 'way' , 'outer' ) , ( 2 , 'way' , 'inner' ) ] ) #NEWLINE# builder = self . relation_builder ( r , None , None ) #NEWLINE# rings = builder . build_rings ( [ w1 , w2 ] ) #NEWLINE# eq_ ( len ( rings ) , 2 ) #NEWLINE# eq_ ( w2 [ 0 ] . geom . area , 100 ) #NEWLINE# eq_ ( rings [ 1 ] . geom . area , 36 ) #NEWLINE# builder . build_relation_geometry ( rings ) #NEWLINE# eq_ ( r . geom . area , ( 100 - 36 ) )