Pipeline¶
The pipeline module is the main entry point for agribound. It orchestrates the full workflow: composite building, optional fine-tuning, delineation, post-processing, LULC crop filtering, evaluation, and export.
The LULC crop filtering step (enabled by default) automatically removes non-agricultural polygons using the best available land-use/land-cover dataset for the study area location and year. See the Configuration Reference for details.
pipeline ¶
Main pipeline orchestrator.
Coordinates the end-to-end workflow: configuration → composite building → optional fine-tuning → delineation → post-processing → export.
delineate ¶
delineate(study_area: str, source: str = 'sentinel2', year: int = 2024, engine: str = 'delineate-anything', output_path: str | None = None, gee_project: str | None = None, local_tif_path: str | None = None, reference_boundaries: str | None = None, fine_tune: bool = False, config: AgriboundConfig | None = None, **kwargs: Any) -> gpd.GeoDataFrame
Run the complete field boundary delineation pipeline.
This is the main entry point for Agribound. Provide a study area, satellite source, year, and engine to get field boundary polygons.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study_area
|
str
|
Path to a GeoJSON/Shapefile/GeoParquet or a GEE vector asset ID. |
required |
source
|
str
|
Satellite source: |
'sentinel2'
|
year
|
int
|
Target year for the annual composite (default 2024). |
2024
|
engine
|
str
|
Delineation engine: |
'delineate-anything'
|
output_path
|
str or None
|
Path for the output vector file. If None, defaults to
|
None
|
gee_project
|
str or None
|
GEE project ID (required for GEE-based sources). |
None
|
local_tif_path
|
str or None
|
Path to a local GeoTIFF (required when |
None
|
reference_boundaries
|
str or None
|
Path to existing field boundaries for fine-tuning or evaluation. |
None
|
fine_tune
|
bool
|
Fine-tune the engine on reference boundaries before inference. |
False
|
config
|
AgriboundConfig or None
|
Pre-built configuration. If provided, overrides individual parameters. |
None
|
**kwargs
|
Any
|
Additional keyword arguments forwarded to :class: |
{}
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
Field boundary polygons. |
Examples:
>>> import agribound
>>> gdf = agribound.delineate(
... study_area="area.geojson",
... source="sentinel2",
... year=2024,
... engine="delineate-anything",
... gee_project="my-project",
... )
>>> gdf.to_file("fields.gpkg")
Source code in agribound/pipeline.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |