Esempio n. 1
0
 def test_polygon(self):
     params = {'distance': 3000}
     link_strategy = Polygon(params)
     ds_a = App.get_ds(self.gf1.get_id())
     ds_b = App.get_ds(self.gf2.get_id())
     dataset = link_strategy.link(ds_a, ds_b)
     linked_file = App.link_polygon(self.gf1.get_id(), self.gf2.get_id(), "name", "description", params)
     dataset_linked = linked_file.get_data()
     pd.testing.assert_frame_equal(dataset, dataset_linked)
Esempio n. 2
0
def link_polygon(request, pk_a, pk_b, max_distance, name, description):
    params = {'distance': max_distance / 1000}
    linked_file = App.link_polygon(pk_a, pk_b, name, description, params)
    [data, cols] = App.make_response_link(linked_file.get_data())
    return Response(data={
        "data": data,
        "id": linked_file.get_id(),
        "cols": cols
    },
                    status=status.HTTP_200_OK)