我不知道你的具体要求,但最快获得一般结果应该是这样的:width = int(shape.bounds[2] - shape.bounds[0])height = int(shape.bounds[3] - shape.bounds[1])points = MultiPoint( [(x,y) for x in range(width) for y in range(height)] )zeroes = points.difference( shape )ones = points.intersection( shape )