added formulas

This commit is contained in:
2026-06-26 12:23:46 +03:00
parent 4df70fa270
commit 83ca6bc12c
8 changed files with 456 additions and 23 deletions
+8 -1
View File
@@ -3,6 +3,7 @@ from __future__ import annotations
from app.config import get_settings
from app.core.coverage import compute_coverage as run_coverage
from app.core.viewshed import compute_viewshed as run_viewshed
from app.deps import SessionLocal
from app.models.coverage import CoverageRequest
from app.models.viewshed import ViewshedRequest
from app.services.jobs import get_job_record, update_job
@@ -19,7 +20,13 @@ def compute_coverage(job_id: str) -> dict[str, str]:
try:
update_job(job_id, status="running")
request = CoverageRequest.model_validate(record["payload"])
result = run_coverage(request, dem_path=str(settings.dem_path))
with SessionLocal() as db:
result = run_coverage(
request,
dem_path=str(settings.dem_path),
output_dir=settings.jobs_output_path,
db=db,
)
update_job(
job_id,
status="done",