def link_similarity_preview(request, pk_a, pk_b): rules = request.data['rules'] results = App.link_files_similarity_preview(pk_a, pk_b, {'rules': rules}) [data, cols] = App.make_response_link(results) return Response(data={ "data": data, "cols": cols }, status=status.HTTP_200_OK)
def link_polygon_preview(request, pk_a, pk_b, max_distance): params = {'distance': max_distance / 1000} results = App.link_files_polygon_preview(pk_a, pk_b, params) [data, cols] = App.make_response_link(results) return Response(data={ "data": data, "cols": cols }, status=status.HTTP_200_OK)
def link_closest_point_preview(request, pk_a, pk_b): params = {'distance': 0, 'filter': False} results = App.link_files_closest_point_preview(pk_a, pk_b, params) [data, cols] = App.make_response_link(results) return Response(data={ "data": data, "cols": cols }, status=status.HTTP_200_OK)
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)
def link_similarity(request, pk_a, pk_b, name, description): rules = request.data['rules'] linked_file = App.link_similarity(pk_a, pk_b, name, description, {'rules': rules}) [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)
def link_closest_point(request, pk_a, pk_b, name, description): params = {'distance': 0, 'filter': False} linked_file = App.link_closest_points(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)
def link_closest_point_filter(request, pk_a, pk_b, max_distance, name, description): # create the strategy params = {'distance': max_distance / 1000, 'filter': True} linked_file = App.link_closest_points(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)