- CollectDB 다중 신호 수집 → S&P Global AIS API 단일 수집으로 전환 - sig_src_cd + target_id 이중 식별자 → mmsi(VARCHAR) 단일 식별자 - t_vessel_latest_position → t_ais_position 테이블 전환 - 레거시 배치/유틸 ~30개 클래스 삭제 (VesselAggregationJobConfig, ShipKindCodeConverter 등) - AisTargetCacheManager 기반 캐시 이중 구조 (최신위치 + 트랙 버퍼) - CacheBasedVesselTrackDataReader + CacheBasedTrackJobListener 신규 추가 - VesselStaticStepConfig: 정적정보 CDC 변경 검출 + hourly job 편승 - SignalKindCode enum: vesselType/extraInfo 기반 선종 자동 분류 - WebSocket/STOMP 전체 mmsi 전환 (StompTrackStreamingService ~40곳) - 모니터링/성능 최적화 코드 mmsi 기반 전환 - DataSource 설정 통합 (snpdb 단일 DB) - AreaBoundaryCache Polygon→Geometry 캐스트 수정 (MULTIPOLYGON 지원) - ConcurrentHashMap 적용 (VesselTrackStepConfig 동시성 버그 수정) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
1.5 KiB
SQL
51 lines
1.5 KiB
SQL
-- 빠른 Invalid Geometry 확인
|
|
|
|
-- 1. t_vessel_tracks_5min에 실제로 invalid geometry가 있는가?
|
|
SELECT
|
|
'5min table - invalid count' as check_type,
|
|
COUNT(*) as invalid_count
|
|
FROM signal.t_vessel_tracks_5min
|
|
WHERE track_geom IS NOT NULL
|
|
AND NOT public.ST_IsValid(track_geom);
|
|
|
|
-- 2. 어떤 invalid 이유인가?
|
|
SELECT
|
|
'5min table - invalid reasons' as check_type,
|
|
public.ST_IsValidReason(track_geom) as reason,
|
|
COUNT(*) as count
|
|
FROM signal.t_vessel_tracks_5min
|
|
WHERE track_geom IS NOT NULL
|
|
AND NOT public.ST_IsValid(track_geom)
|
|
GROUP BY public.ST_IsValidReason(track_geom);
|
|
|
|
-- 3. 실제 invalid 샘플 확인
|
|
SELECT
|
|
'5min table - invalid samples' as check_type,
|
|
sig_src_cd,
|
|
target_id,
|
|
time_bucket,
|
|
public.ST_NPoints(track_geom) as point_count,
|
|
public.ST_AsText(track_geom) as wkt,
|
|
public.ST_IsValidReason(track_geom) as reason
|
|
FROM signal.t_vessel_tracks_5min
|
|
WHERE track_geom IS NOT NULL
|
|
AND NOT public.ST_IsValid(track_geom)
|
|
LIMIT 5;
|
|
|
|
-- 4. 에러 발생한 선박 확인 (vessel 000001_###0000072)
|
|
SELECT
|
|
'Problem vessel check' as check_type,
|
|
sig_src_cd,
|
|
target_id,
|
|
time_bucket,
|
|
public.ST_NPoints(track_geom) as point_count,
|
|
public.ST_IsValid(track_geom) as is_valid,
|
|
public.ST_IsValidReason(track_geom) as reason,
|
|
public.ST_AsText(track_geom) as wkt
|
|
FROM signal.t_vessel_tracks_5min
|
|
WHERE sig_src_cd = '000001'
|
|
AND target_id LIKE '%0000072'
|
|
AND time_bucket >= CURRENT_TIMESTAMP - INTERVAL '1 day'
|
|
ORDER BY time_bucket DESC
|
|
LIMIT 10;
|