Logo Lanfrica

fgashakamba/Farmer-touchpoints

Domain:

agriculturegeospatial

Record type:

software
Creator:
fga
Host:
This is a shiny (python) show all touchpoints available for extension related services to OAF farmers in Rwanda # Tubura Extension Map MVP This MVP is a Shiny for Python app optimized for fast startup and fast interaction. Python performs the spatial joins and geometry simplification once in a build step. The running app serves compact static assets, while filtering, cell/sector shading, person-level agent counts, selection, KPI updates, URL state, and CSV export happen in the browser. ## Why Python rather than R The existing `geo` Conda environment already contains Shiny for Python, GeoPandas, Shapely, PyProj, and the other required libraries. The installed R runtime does not currently contain Shiny, `sf`, Leaflet, or their dependencies. Using the existing Python environment avoids a slow and fragile dependency installation and supports a precomputed, browser-first interaction model. ## Build the map assets First regenerate the compact farmer-by-cell aggregate when the cleaned VFINERACT client export changes: ```powershell C:\ProgramData\anaconda3\Scripts\conda.exe run -n geo python scripts\update_farmer_counts.py ``` Then rebuild the browser assets whenever an aggregate input or GeoPackage file changes: ```powershell C:\ProgramData\anaconda3\Scripts\conda.exe run -n geo python scripts\prepare_data.py ``` The map build reads farmer totals from `Input data/Farmers_by_cell.csv`. The raw `VFINERACT_CLIENTS_RW_cleaned.csv` is used only by the preprocessing command; unmatched client records are excluded from cell counts and summarized in `Input data/Farmers_by_cell.qa.json`. The build reads six agent-group files: Tubura FOs, Tubura nursery out-growers, FoBaSi agents, Farmer Promoters, HTE Agents, and Tubura Group Leaders. For FoBaSi, the supplied `longitude` and `latitude` are the canonical site-centroid location. A site may list multiple districts, sectors, or cells, so those plural coverage columns do not determine its map geography; a point-in-polygon join of the centroid assigns one canonical cell, sector, and district. FoBaSi coordinates never fall back to a cell c …