kcg-monitoring/database/migration/008_transshipment.sql
htlee d9ba1b0e1a feat: 환적탐지 Python 이관 — O(n²) 프론트엔드 근접탐지 → 서버사이드 공간인덱스
- prediction/algorithms/transshipment.py 신규: 그리드 공간인덱스 O(n log n) 환적 쌍 탐지
  → 후보 필터(sog<2, tanker/cargo/fishing, 외국해안 제외) + 110m 근접 + 60분 지속
- prediction/scheduler.py: 8단계 환적탐지 사이클 추가, pair_history 영속화
- prediction/models/result.py: is_transship_suspect, transship_pair_mmsi, transship_duration_min
- prediction/db/kcgdb.py: UPSERT 쿼리에 3개 컬럼 추가
- database/migration/008_transshipment.sql: ALTER TABLE 3개 컬럼 추가
- backend VesselAnalysisResult + VesselAnalysisDto: TransshipInfo 중첩 DTO 추가
- frontend types.ts: algorithms.transship 타입 추가
- frontend useKoreaFilters.ts: O(n²) 65줄 → analysisMap 소비 8줄
  → currentTime 매초 의존성 제거, proximityStartRef 제거

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:29:44 +09:00

8 lines
332 B
SQL

-- 008: 환적 의심 탐지 필드 추가
SET search_path TO kcg, public;
ALTER TABLE vessel_analysis_results
ADD COLUMN IF NOT EXISTS is_transship_suspect BOOLEAN NOT NULL DEFAULT FALSE,
ADD COLUMN IF NOT EXISTS transship_pair_mmsi VARCHAR(15) DEFAULT '',
ADD COLUMN IF NOT EXISTS transship_duration_min INTEGER DEFAULT 0;