#NEWLINE# def test_polygon_w_touching_holes( self ) : #NEWLINE# #INDENT# w1 = Way ( 1 , { #NEWLINE# #INDENT# 'landusage' : 'forest' , #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# 'landusage' : 'scrub' , #NEWLINE# #UNINDENT# } , [ 1 , 2 , 3 , 4 , 1 ] ) #NEWLINE# w2 . coords = [ ( 1 , 1 ) , ( 5 , 1 ) , ( 5 , 9 ) , ( 1 , 9 ) , ( 1 , 1 ) ] #NEWLINE# w3 = Way ( 3 , { #NEWLINE# #INDENT# 'water' : 'basin' , #NEWLINE# #UNINDENT# } , [ 1 , 2 , 3 , 4 , 1 ] ) #NEWLINE# w3 . coords = [ ( 5 , 1 ) , ( 9 , 1 ) , ( 9 , 9 ) , ( 5 , 9 ) , ( 5 , 1 ) ] #NEWLINE# r = Relation ( 1 , { #NEWLINE# #INDENT# 'landusage' : 'forest' , #NEWLINE# #UNINDENT# } , [ ( 1 , 'way' , 'outer' ) , ( 2 , 'way' , 'inner' ) , ( 3 , 'way' , 'inner' ) ] ) #NEWLINE# builder = self . relation_builder ( r , None , None ) #NEWLINE# rings = builder . build_rings ( [ w1 , w2 , w3 ] ) #NEWLINE# eq_ ( len ( rings ) , 3 ) #NEWLINE# eq_ ( rings [ 0 ] . geom . area , 100 ) #NEWLINE# eq_ ( rings [ 1 ] . geom . area , 32 ) #NEWLINE# eq_ ( rings [ 2 ] . geom . area , 32 ) #NEWLINE# builder . build_relation_geometry ( rings ) #NEWLINE# eq_ ( rings [ 0 ] . inserted , True ) #NEWLINE# eq_ ( rings [ 1 ] . inserted , False ) #NEWLINE# eq_ ( w3 [ 2 ] . inserted , False ) #NEWLINE# eq_ ( r . geom . area , ( 100 - 64 ) )