ASAgriSense/Docs/Farm Mapping

Module 3

Farm Mapping & Geospatial

Purpose#

Captures verified GPS polygon boundaries for every farm plot — the primary EUDR data requirement. A farm belongs to a farmer; a farm can have multiple plots; each plot has exactly one polygon (or centroid).

EUDR geolocation rules#

Regulatory requirement
These rules are not optional — they are a legal requirement under EUDR Article 9. Every plot 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 (plots table)
SELECT ST_Area(ST_Transform(polygon_geom, 3857)) / 10000 AS area_ha
FROM plots
WHERE id = $1;

Data model#

EntityRelationshipKey fields
FarmBelongs to one farmerName, commodity type, land tenure, area_ha
PlotBelongs to one farm (farm can have multiple plots)polygon_geom (PostGIS geometry), area_ha, capture_method, risk_level

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 plots 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 plot has a risk_level field populated by the Deforestation Risk Assessment module (Module 4):

LevelMeaning
lowNo deforestation detected on this plot 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. Plot is flagged non-compliant. Remediation required.
pendingAssessment requested but not yet returned from the provider.
unavailableProvider could not assess this plot (e.g. missing polygon, cloud cover).

Packages#

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

Key Zod schemas#

  • CreateFarmSchema
  • CreatePlotSchema
  • GeoJsonPolygonSchema
  • GeoJsonPointSchema
  • PlotAttributesSchema
  • 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.