How h3ndrick/agroguard-api works
AgroGuard serves municipal environmental-risk and agricultural-suitability scores. A user selects a state and queries a location; the API resolves its municipality, loads or calculates state-level component scores, and returns a combined risk report plus separate ZARC suitability. The graph preserves the documented SISSER and ZARC branches and shared percentile normalization. Data-loading details and some endpoint wiring are only partially excerpted, so those relationships rely on README statements where noted.
Main entry points: api.py FastAPI service · normalizacao.py Percentile normalization · score_fogo.py Fire score · score_agricola.py Agricultural score
Components 15
User experience
- Map and search
static/index.html
API and geography
- FastAPI service
api.py - Municipality lookup
api.py - State score cache
api.py
Scoring modules
- Fire score
scores/score_fogo.py - Climate score
scores/score_climatico.py - Agricultural score
scores/score_agricola.py - SISSER exposure
scores/score_sisser.py - ZARC suitability
scores/score_zarc.py - Percentile normalization
scores/normalizacao.py - Risk report
scores/score_geral.py
Data sources
- Municipal boundaries
static/municipios.json - State outlines
static/go_contorno.json - Public data sources
Other components
- User
Connections 23
- User → Map and search: selects location
README.md - Map and search → FastAPI service: requests scores
README.md - FastAPI service → Municipality lookup: resolves coordinates
README.md - Municipality lookup → Municipal boundaries: uses boundaries
README.md - FastAPI service → State score cache: loads state
README.md - FastAPI service → Fire score: calculates fire
api.py - FastAPI service → Climate score: calculates climate
api.py - FastAPI service → Agricultural score: calculates agriculture
api.py - FastAPI service → SISSER exposure: aggregates insurance
api.py - FastAPI service → ZARC suitability: aggregates suitability
api.py - FastAPI service → Risk report: builds report
api.py - Fire score → Percentile normalization: normalizes components
scores/score_fogo.py - Climate score → Percentile normalization: normalizes components
scores/score_climatico.py - Agricultural score → Percentile normalization: normalizes components
scores/score_agricola.py - SISSER exposure → Percentile normalization: normalizes components
scores/score_sisser.py - ZARC suitability → Percentile normalization: normalizes components
scores/score_zarc.py - Risk report → FastAPI service: returns report
api.py - FastAPI service → State outlines: serves outline
README.md - Public data sources → Fire score: supplies fire records
README.md - Public data sources → Agricultural score: supplies irrigation data
README.md - Public data sources → SISSER exposure: supplies insurance data
README.md - Public data sources → ZARC suitability: supplies zoning data
README.md - Public data sources → Municipal boundaries: supplies boundaries
README.md