#NEWLINE# def invalidate( self , proj ) : #NEWLINE# #INDENT# self . painter = BatchPainter ( ) #NEWLINE# ( x , y ) = proj . lonlat_to_screen ( self . data [ 'lon' ] , self . data [ 'lat' ] ) #NEWLINE# k_means = KMeans ( n_clusters = self . k ) #NEWLINE# k_means . fit ( np . vstack ( [ x , y ] ) . T ) #NEWLINE# labels = k_means . labels_ #NEWLINE# self . cmap = create_set_cmap ( set ( labels ) , 'hsv' ) #NEWLINE# for l in set ( labels ) : #NEWLINE# #INDENT# self . painter . set_color ( self . cmap [ l ] ) #NEWLINE# self . painter . convexhull ( x [ ( labels == l ) ] , y [ ( labels == l ) ] ) #NEWLINE# self . painter . points ( x [ ( labels == l ) ] , y [ ( labels == l ) ] , 2 )