# System Integration Test: Satellite to Vision Pipeline

## Summary
Validate integration between Satellite Data Manager and vision processing layers (L2, L3).

## Components Under Test
- Satellite Data Manager
- Coordinate Transformer
- Global Place Recognition (L2)
- Metric Refinement (L3)
- Configuration Manager

## Test Scenario
Test the flow of satellite data through vision pipeline:
1. Download satellite tiles for operational area
2. Build Faiss index for L2 (AnyLoc)
3. Use tiles as reference for L3 (LiteSAM)
4. Validate GPS accuracy depends on satellite data quality

## Test Cases

### Test Case 1: Satellite Tile Download and Caching
- Request tiles for AD000001-AD000010 locations
- Verify tiles cached locally
- Check georeferencing accuracy

### Test Case 2: L2 Global Place Recognition with Satellites
- Query L2 with AD000001.jpg
- Verify retrieves correct satellite tile
- Distance to ground truth < 200m

### Test Case 3: L3 Metric Refinement with Satellite
- Use AD000001.jpg and retrieved satellite tile
- Run LiteSAM cross-view matching
- Verify GPS accuracy < 20m

### Test Case 4: Outdated Satellite Data (AC requirement)
- Simulate outdated satellite imagery
- Verify DINOv2 features still match
- Accuracy may degrade but system continues

### Test Case 5: Missing Satellite Tile
- Request tile for area without coverage
- Verify graceful failure
- System requests alternative or skips

## Success Criteria
- Satellite tiles download and georeference correctly
- L2 retrieves correct tiles (top-5 accuracy > 85%)
- L3 achieves < 20m accuracy with good satellite data
- System handles missing/outdated tiles gracefully

## Maximum Expected Time
- Tile download (10 tiles): < 60 seconds
- Faiss index build: < 30 seconds
- L2 queries (10): < 2 seconds
- L3 refinements (10): < 1.5 seconds
- Total test: < 120 seconds

## Pass/Fail Criteria
**Passes If**: Satellite data flows correctly through vision pipeline, accuracy targets met
**Fails If**: Tile download fails, georeferencing incorrect, L2/L3 cannot use satellite data

