#NEWLINE# def remove_empty_shapes( self , target ) : #NEWLINE# #INDENT# '\n        Remove any shapes that ended up binning zero points.\n        ' #NEWLINE# another_polygon = True #NEWLINE# while another_polygon : #NEWLINE# #INDENT# polygon = target . GetNextFeature ( ) #NEWLINE# if polygon : #NEWLINE# #INDENT# count = polygon . GetFieldAsInteger ( 'COUNT' ) #NEWLINE# if ( count == 0 ) : #NEWLINE# #INDENT# target . DeleteFeature ( polygon . GetFID ( ) ) #NEWLINE# #UNINDENT# target . SetFeature ( polygon ) #NEWLINE# polygon . Destroy ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# another_polygon = False #NEWLINE# target . ResetReading ( )