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