feat(cadastre): bulk_harvest worker + grid-walker + admin API (#168 PR3/5) #171

Merged
lekss361 merged 4 commits from feat/cadastre-bulk-worker into main 2026-05-15 10:31:33 +00:00
2 changed files with 7 additions and 6 deletions
Showing only changes of commit 32eeda5db1 - Show all commits

View file

@ -57,8 +57,7 @@ def quarter_bbox_3857(db: Session, quarter: str) -> tuple[float, float, float, f
def generate_grid_click_points(
bbox: tuple[float, float, float, float],
grid_size: int = 15,
tile_width: int = 512,
tile_height: int = 512,
tile_size: int = 512,
) -> list[tuple[tuple[float, float, float, float], tuple[int, int]]]:
"""Генерировать grid_size × grid_size ячеек для bbox квартала.
@ -69,8 +68,7 @@ def generate_grid_click_points(
Args:
bbox: (xmin, ymin, xmax, ymax) в EPSG:3857.
grid_size: количество ячеек по каждой оси (15 225 запросов).
tile_width: ширина виртуального WMS тайла в пикселях.
tile_height: высота виртуального WMS тайла в пикселях.
tile_size: размер виртуального WMS тайла в пикселях (квадратный).
Returns:
Список (sub_bbox, click_xy) sub_bbox в EPSG:3857, click_xy в пикселях.
@ -88,8 +86,8 @@ def generate_grid_click_points(
cell_xmax = cell_xmin + x_step
cell_ymax = cell_ymin + y_step
# Клик в центр ячейки
click_x = tile_width // 2
click_y = tile_height // 2
click_x = tile_size // 2
click_y = tile_size // 2
result.append(
(
(cell_xmin, cell_ymin, cell_xmax, cell_ymax),

View file

@ -79,3 +79,6 @@ strict = true
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
markers = [
"slow: marks tests as slow (need real network, deselect with -m 'not slow')",
]