| from __future__ import annotations |
|
|
| from dataclasses import dataclass, field |
| from typing import Any, Literal |
|
|
|
|
| SelectionType = Literal[ |
| "drawn_polygon", |
| "rectangle", |
| "pin_radius", |
| "dxf_boundary", |
| "geojson_boundary", |
| "kml_boundary", |
| "reference_only", |
| ] |
| CoordinateMode = Literal["wgs84", "local_cad", "anchored_local_cad", "unknown"] |
| Confidence = Literal["high", "medium", "low"] |
| OutputLabel = Literal[ |
| "computed", |
| "public_data", |
| "cad_derived", |
| "user_input", |
| "ai_interpretation", |
| "site_visit_required", |
| "professional_verification_required", |
| ] |
|
|
|
|
| @dataclass |
| class SiteSelection: |
| id: str |
| selection_type: SelectionType |
| coordinate_mode: CoordinateMode |
| geometry_geojson: dict[str, Any] | None |
| local_geometry: list[tuple[float, float]] | None |
| anchor_lat: float | None |
| anchor_lon: float | None |
| radius_m: float | None |
| area_sqm: float | None |
| perimeter_m: float | None |
| centroid: tuple[float, float] | None |
| bbox: tuple[float, float, float, float] | None |
| unit_source: str |
| accuracy_label: str |
| source_files: list[str] = field(default_factory=list) |
| selected_boundary_id: str | None = None |
| limitations: list[str] = field(default_factory=list) |
|
|
|
|
| @dataclass |
| class BoundaryCandidate: |
| id: str |
| source_file: str |
| layer_name: str |
| unit: str |
| area_sqm: float |
| perimeter_m: float |
| vertex_count: int |
| is_closed: bool |
| bbox: tuple[float, float, float, float] |
| confidence_reason: str |
| points_m: list[tuple[float, float]] = field(default_factory=list) |
|
|
|
|
| @dataclass |
| class LayerFeature: |
| source_file: str |
| layer_name: str |
| feature_type: str |
| interpreted_category: str |
| count: int |
|
|
|
|
| @dataclass |
| class EvidenceItem: |
| id: str |
| category: str |
| finding: str |
| source_name: str |
| source_url: str |
| source_type: str |
| resolution_or_scope: str |
| confidence: Confidence |
| limitation: str |
| design_implication: str |
| verification_needed: str |
| output_label: OutputLabel |
|
|
|
|
| @dataclass |
| class ReportBundle: |
| board_markdown: str |
| evidence_rows: list[EvidenceItem] |
| checklist_markdown: str |
| diagram_paths: list[str] |
| export_path: str | None |
| warnings: list[str] = field(default_factory=list) |
|
|