> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agronome.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Drone Pipeline

> Upload, process, and analyze drone imagery end to end

# Drone Pipeline

agronome.ai processes drone imagery through an automated pipeline that takes raw images from your drone and produces georeferenced vegetation index maps, elevation models, and orthomosaics.

## Pipeline stages

```
Upload → EXIF Analysis → ODM Processing → Post-Processing → Tile Generation → View in Analyze Tab
```

### 1. Upload

Upload drone images through the web interface. Images are uploaded directly to Google Cloud Storage using signed URLs — large uploads never pass through the API server.

**Supported cameras:**

* DJI Mavic 3 Multispectral (multispectral + RGB)
* DJI Phantom 4 Multispectral
* MicaSense RedEdge-MX / Altum
* Any RGB camera (orthomosaic only)

### 2. EXIF analysis

Once upload completes, agronome.ai automatically extracts EXIF metadata from every image:

* **Camera identification** — model, sensor type (RGB vs. multispectral), band configuration
* **GPS coordinates** — flight area, altitude, ground sampling distance (GSD)
* **Band detection** — identifies available spectral bands (Red, Green, Blue, Red Edge, NIR)
* **Irradiance data** — DJI irradiance values for radiometric calibration

This determines which vegetation indices can be generated. A multispectral flight with NIR and Red Edge bands enables NDVI, NDRE, GNDVI, SAVI, and EVI. An RGB-only flight produces orthomosaics and elevation models.

### 3. ODM processing

Raw images are processed by [OpenDroneMap (ODM)](https://www.opendronemap.org/) running on GCP Batch with Spot VMs:

* **Orthomosaic** — georeferenced, stitched aerial image
* **Digital Surface Model (DSM)** — elevation data for canopy height modeling
* **Point cloud** — 3D reconstruction of the flight area

Processing runs on cost-efficient Spot VMs with automatic retry on preemption.

### 4. Post-processing

After ODM completes, the post-processor generates:

* **Vegetation indices** — NDVI, NDRE, GNDVI, SAVI, EVI calculated from multispectral bands
* **Canopy Height Model (CHM)** — derived from DSM
* **COG conversion** — all rasters converted to Cloud-Optimized GeoTIFF
* **Color relief** — `gdaldem color-relief` applies scientifically accurate colormaps

### 5. Tile generation

Pre-rendered PNG tiles are generated using `gdal2tiles.py` at standard web map zoom levels. Each layer gets its own tile set:

```
{org_id}/{job_id}/tiles/{layer_type}/{colormap}/{z}/{x}/{y}.png
```

Tiles are served as static files from GCS through an authenticated API proxy. No dynamic tile server — tiles are generated once and cached permanently.

### 6. Viewing

Processed layers appear in the **Analyze** tab on the field detail page. You can:

* Switch between layer types (NDVI, NDRE, orthomosaic, elevation, etc.)
* Toggle colormaps for vegetation indices
* Compare layers side-by-side
* View a timeline of all drone flights and satellite passes for the field

## Job statuses

| Status            | Meaning                                         |
| ----------------- | ----------------------------------------------- |
| `pending_upload`  | Signed URLs generated, waiting for image upload |
| `uploading`       | Images being uploaded to GCS                    |
| `analyzing`       | EXIF metadata extraction in progress            |
| `ready`           | Analysis complete, queued for ODM processing    |
| `processing`      | ODM stitching running on GCP Batch              |
| `post_processing` | Vegetation indices and tiles being generated    |
| `completed`       | All layers available for viewing                |
| `failed`          | Processing error (check logs for details)       |
