def reduce_shape(shapes):
    new_shapes = []
    if shapes['type'] == "Polygon":
        for shape in shapes['coordinates'][0]:
            new_shapes.append([round(x, 7) for x in shape])
        shapes['coordinates'] = [new_shapes]
        return shapes
    else:
        for i in range(0, len(shapes['coordinates'])):
            multi_shape = []
            for shape in shapes['coordinates'][i][0]:
                multi_shape.append([round(x, 7) for x in shape])
            new_shapes.append([multi_shape])
        shapes['coordinates'] = new_shapes
        return shapes
Serialize a dict into a string and wrap in a wsgi.Request object.
dataset/ETHPy150Open anthill/open-moulinette/caf/scripts/Merging.py/reduce_shape--crossover with--dataset/ETHPy150Open nii-cloud/dodai-compute/nova/api/openstack/wsgi.py/ResponseSerializer.serialize