ASAgriSense/Docs/Farm Mapping

Module 3

Farm Mapping & Geospatial

Purpose#

Captures a verified GPS polygon or point for every farm — the primary EUDR geolocation requirement. A farmer can have multiple independently mapped farms, including multiple farms for the same commodity.

EUDR geolocation rules#

Regulatory requirement
These rules are not optional — they are a legal requirement under EUDR Article 9. Every farm must have a polygon or GPS centroid in WGS84 (EPSG:4326) before EUDR compliance can be assessed.
Farm sizeRequired captureCoordinate system
> 4 hectaresFull perimeter polygon (set of WGS84 coordinates)WGS84 / EPSG:4326
≤ 4 hectaresGPS centroid (single point) — polygon preferred where possibleWGS84 / EPSG:4326

Area is calculated from the polygon using PostGIS:

sql
-- Area in hectares for the current farm polygon
SELECT ST_Area(ST_Transform(geometry, 3857)) / 10000 AS area_ha
FROM farm_geometries
WHERE farm_id = $1 AND is_current = true;

Data model#

EntityRelationshipKey fields
FarmBelongs to one farmerFarm code, commodity, estimate, actual area, risk
Farm mappingOne current polygon or point per farmWGS84 geometry and coordinate

Polygon capture methods#

MethodWhen to use
Mobile GPS walk-aroundOfficer walks the perimeter of the farm with the mobile app open. App records GPS coordinates every N seconds to form a polygon.
Web KML/GeoJSON uploadUpload a KML or GeoJSON file (e.g. exported from QGIS or Google Earth).
Manual coordinate entryEnter polygon vertices by hand. Useful for small farms where a walk would be impractical.

Satellite overlay#

The web map view overlays the captured polygon on satellite imagery for visual verification. This allows the officer or manager to confirm the polygon boundary looks correct before triggering a deforestation risk assessment.

Risk levels#

Each farm has a risk_level field populated by the Deforestation Risk Assessment module (Module 4):

LevelMeaning
lowNo deforestation detected on this farm since 31 December 2020.
mediumMinor vegetation change detected; below threshold for non-compliance.
highSignificant forest loss detected; requires remediation before EUDR compliance is possible.
criticalConfirmed deforestation. Farm is flagged non-compliant. Remediation required.
pendingAssessment requested but not yet returned from the provider.
unavailableProvider could not assess this farm (e.g. missing polygon, cloud cover).

Packages#

PackageTypeKey exports
@repo/feature-farm-mappingBackendServices: farm lifecycle, mapping, geospatial operations, export (GeoJSON)
@repo/feature-farm-mapping-webFrontendMap component, farm list, farm form, coordinate editor

Key Zod schemas#

  • CreateFarmSchema
  • UpdateFarmSchema
  • MapFarmSchema
  • GeoJsonPolygonSchema
  • GeoJsonPointSchema
  • FarmAttributesSchema
  • CaptureMethodSchema
Export formats
Farm data can be exported as GeoJSON (for EUDR Due Diligence Statements and GIS tools) or CSV. Export endpoints are on the API routes for the farm-mapping module.