<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->

# API Reference — Performing Geolocation Analysis

## ExifTool

### GPS Extraction Commands

| Command | Description |
|---|---|
| `exiftool -gps:all <file>` | Extract all GPS-related tags |
| `exiftool -n -gpslatitude -gpslongitude <file>` | GPS as decimal degrees |
| `exiftool -json -gps:all <file>` | GPS data as JSON |
| `exiftool -csv -gps:all *.jpg` | Batch extract to CSV |
| `exiftool -ee -gps:all video.mp4` | Extract embedded GPS from video |

### Useful EXIF Tags

| Tag | Description |
|---|---|
| `GPSLatitude` | Latitude in DMS or decimal |
| `GPSLongitude` | Longitude in DMS or decimal |
| `GPSAltitude` | Altitude above sea level |
| `GPSDateTime` | GPS timestamp (UTC) |
| `DateTimeOriginal` | Camera capture timestamp |
| `Make` / `Model` | Camera manufacturer and model |
| `LensModel` | Lens used (focal length estimation) |

## Google Earth Pro

### Key Operations

| Action | Method |
|---|---|
| Navigate to coordinates | Search bar: `48.8566, 2.3522` |
| Historical imagery | View → Historical Imagery (clock icon) |
| Measure distance | Tools → Ruler → Line |
| 3D perspective match | Tilt and rotate to match source image angle |
| Save placemark | Add → Placemark at current view |
| Export KML | File → Save Place As → KML |

## Agent Script

```bash
# Extract GPS coordinates from image
node agent.js extract-gps photo.jpg

# Convert DMS to decimal
node agent.js dms-to-decimal --lat "48 51 24" --lon "2 21 7"

# Export to KML
node agent.js export-kml --lat 48.8566 --lon 2.3522 --label "Target"

# Feature-based search
node agent.js feature-search --features "church,river,red roof" --region europe

# Verify image against coordinates
node agent.js verify-location --image photo.jpg --lat 48.8566 --lon 2.3522

# Self-test
node agent.js --self-test
```

## Coordinate Systems

| Format | Example |
|---|---|
| Decimal Degrees (DD) | 48.856614, 2.352222 |
| Degrees Minutes Seconds (DMS) | 48° 51' 23.81" N, 2° 21' 7.99" E |
| UTM | 31U 448251 5411932 |
| MGRS | 31UDQ4825111932 |
