Satellite-backed EUDR deforestation compliance checker for cocoa farms — Telegram chatbot guides farmers in Twi, Dioula & French to map their land, checks it against Hansen GFC satellite data, and generates a PDF evidence pack.
# EUDR Farm Checker
A satellite-backed deforestation compliance tool for cocoa cooperatives under the **EU Deforestation Regulation (EUDR) 2023/1115**.
Farmers walk their farm boundary, a Telegram chatbot guides them in their local language (Twi, Dioula, French), and the system automatically checks the land against Hansen satellite data — returning a signed PDF evidence pack in seconds.
---
## What It Does
```
Farmer chats with Riyo bot in Twi/Dioula/French
↓
Shares GPS location pins at each farm corner
↓
Bot builds a GeoJSON polygon + validates the walk
↓
Checks polygon against Hansen Global Forest Change 2023
↓
Detects overlap with other registered farms (cadastral fraud check)
↓
Generates a PDF evidence pack with SHA-256 integrity checksum
↓
Sends PASS ✅ or FAIL ❌ result + PDF back to farmer on Telegram
```
---
## Demo
| Farm | Location | Result |
|------|----------|--------|
| Kofi Mensah | Tai Forest, Ivory Coast | **FAIL** — 1,854 pixels of post-2020 loss |
| Ama Owusu | Tai Forest (adjacent) | **PASS** |
| Kwame Asante | Atlantic Ocean (clean control) | **PASS** |
| Fatima Coulibaly | Ocean — overlaps F003 | **PASS + cadastral conflict flagged** |
---
## Key Concepts
**EUDR cutoff:** 31 December 2020. Any deforestation after this date = FAIL.
**Hansen GFC dataset:** Free public satellite raster — each pixel is 30×30m. Value 0 = no loss, 1–20 = loss 2001–2020 (legal), 21–23 = loss 2021–2023 (FAIL trigger).
**Cloud-Optimised GeoTIFF:** Tiles are fetched via HTTP range requests — only the pixels inside the farm polygon are downloaded, not the full 500MB tile.
**Cadastral fraud check:** Each new farm polygon is checked against all existing registered farms using Shapely `.overlaps()`. Shared land is flagged before certification.
**Walk validation:** Consecutive GPS corners are validated for timing (min 20s apart) and distance (max 2km apart) to detect impossible submissions.
---
## Project Structure
```
glosys/
├── checker.py # Core sat …