Добавил объединение источников. Вернул норм карту. Удалил ненужные либы

This commit is contained in:
2025-11-26 10:33:07 +03:00
parent 388753ba31
commit 609fd5a1da
10 changed files with 785 additions and 1100 deletions

View File

@@ -11,7 +11,7 @@ from django.shortcuts import redirect, render
from django.utils.decorators import method_decorator
from django.views import View
from ..clusters import get_clusters
# from ..clusters import get_clusters
from ..mixins import RoleRequiredMixin
from ..models import ObjItem
@@ -418,19 +418,19 @@ class ShowSourceAveragingStepsMapView(LoginRequiredMixin, View):
return render(request, "mainapp/source_averaging_map.html", context)
class ClusterTestView(LoginRequiredMixin, View):
"""Test view for clustering functionality."""
# class ClusterTestView(LoginRequiredMixin, View):
# """Test view for clustering functionality."""
def get(self, request):
objs = ObjItem.objects.filter(
name__icontains="! Astra 4A 12654,040 [1,962] МГц H"
)
coords = []
for obj in objs:
if hasattr(obj, "geo_obj") and obj.geo_obj and obj.geo_obj.coords:
coords.append(
(obj.geo_obj.coords.coords[1], obj.geo_obj.coords.coords[0])
)
get_clusters(coords)
# def get(self, request):
# objs = ObjItem.objects.filter(
# name__icontains="! Astra 4A 12654,040 [1,962] МГц H"
# )
# coords = []
# for obj in objs:
# if hasattr(obj, "geo_obj") and obj.geo_obj and obj.geo_obj.coords:
# coords.append(
# (obj.geo_obj.coords.coords[1], obj.geo_obj.coords.coords[0])
# )
# get_clusters(coords)
return JsonResponse({"success": "ок"})
# return JsonResponse({"success": "ок"})