---
title: "Get Field Cover Duration In Days From Epsg:4326 Geojson Input"
method: POST
path: "/agri/field/cover"
tags: ["AGRI endpoints"]
---

# Get Field Cover Duration In Days From Epsg:4326 Geojson Input

`POST /agri/field/cover`

Get cover duration (number of days per year) for each feature (boundaries) in the EPSG:4326 Geojson request body (could be a collection of points, polygons, etc.)

If weighted_mean is true, add in the response the weighted_mean propertie

Returns the input Geojson in which each feature embeds cover information, as follows : 
```
"properties": {
    "data": [
         {
            "year": 2020,
            "method": "original",
            "stats": {
                "count": 490,
                "sum": 103892,
                "mean": 212.02448979591836,
                "stddev": 15.118424097394243,
                "min": 194,
                "max": 291,
                "majority": 205,
                "majority_count": 48,
                "p_area": 0.000006334409353705055
            },
            "pra_stats": {
                "name": "praREGION_CENTRALE_comSAINT_GILLES",
                "ddc_meanp_pra_all": 325,
                "ddc_70qp_pra_all": 344,
                "ddc_meanp_pra_grd_culture": 307,
                "ddc_70qp_pra_grd_culture": 326,
                "ddc_q3_pra_grd_culture": 341,
                "ddc_meanp_pra_div": 317,
                "ddc_70qp_pra_div": 336,
                "ddc_q3_pra_div": 363,
                "area": 0.000006334409353705055
            },
            "weighted_mean": 212 
        }
    ]
},
```
The `majority` property gives the most frequent cover duration (in days) present in the feature

In the purepixel calculation, majority corresponds to the mean value (no actual majority is computed)

## Query parameters

- `year_from` integer — YEAR of the dataset to query - defaults to last year of available dataset
- `year_to` integer — YEAR of the dataset to query - defaults to last year of available dataset
- `purepixels` boolean — If true, activate purepixels calculation (only pixels fully inside input geometry are considered, False by default)
- `weighted_mean` boolean — If true, consider the geoJSON has an exploitation geometry and, so, compute the weighted average of the field cover, False by default

## Request body

- object — EPSG:4326 Geojson FeatureCollection request body

## Response `200`

Successful Response

- unknown

## Other responses

- `403` — Area out of bounds, you are not allowed to query the requested data
- `404` — Not found
- `412` — No feature detected in Geojson input
- `422` — Validation Error

---

[API](https://skmtc.dev/nimbo/apis/nimbo-api.md) · [All operations](https://skmtc.dev/nimbo/apis/nimbo-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nimbo/nimbo-api/revisions/33ea0b26547a/schema)
