Farm Fields¶
Farm Field Attributes¶
Attribute | Name |
---|---|
id | The ID of the given Farm Field. Ignored when creating a new farm field. |
grower | The grower the field belongs to. |
center | The lattitude and longitude of the center point of the fields. Specifically, the center point of the minimum bounding rectangle of all the polygons that make up the farm field. This is always expressed in the EPSG:4326 spatial reference system. |
crop | The crop assigned to the farm field. |
comments | Any comments attached to the farm field. |
adjacents_verified_by | The name of the person who verified the accuracy of the adjacent crops on the given farm field. |
fields | An array of fields that define the farm field’s field boundaries. |
customer_field_id | The user entered ID that allows users to identify Fields across their systems. Also used for integration. |
Sample¶
{
"id": 601916,
"grower": {
"id": 112619,
"grower_id": ""
},
"center": {
"lat": 40.85057409923209,
"lng": -95.83350419998169
},
"crop": {
"id": 143,
"name": "-Unknown-"
},
"comments": "",
"adjacents_verified_by": null,
"fields": [
{
"name": "Fremont D1",
"actual_acres": 254.0,
"geom": {
"type": "Polygon",
"coordinates": [
[
[
-95.83451271057127,
40.85743168374378
],
[
-95.83030700683594,
40.85134542065296
],
[
-95.8267879486084,
40.8506961862558
],
[
-95.8288049697876,
40.8480017955269
],
[
-95.8276033401489,
40.8437165147204
],
[
-95.8381175994873,
40.8437165147204
],
[
-95.840220451355,
40.8485861305308
],
[
-95.83451271057127,
40.85743168374378
]
]
]
}
}
],
"customer_field_id": null
}
Endpoints¶
/api/farm_fields¶
POST¶
Creates a new farm field for any growers the user has access to with a matching grower_id attribute. If there are no growers found, this endpoint will return an error. Returns attributes for the newly created farm field.
Parameters¶
This method requires a farm field in the body of the request, including a grower with the grower_id attribute specified to identify the growers the farm field will be added to.
Returns¶
Returns an array of the newly created farm fields including the grower each field was created on.
Sample¶
{
"id": 601916,
"grower": {
"id": 112619,
"grower_id": "TESTGROWER"
},
"center": {
"lat": 40.85057409923209,
"lng": -95.83350419998169
},
"crop": {
"id": 143,
"name": "-Unknown-"
},
"comments": "",
"adjacents_verified_by": null,
"fields": [
{
"name": "Fremont D1",
"actual_acres": 254.0,
"geom": {
"type": "Polygon",
"coordinates": [
[
[
-95.83451271057127,
40.85743168374378
],
[
-95.83030700683594,
40.85134542065296
],
[
-95.8267879486084,
40.8506961862558
],
[
-95.8288049697876,
40.8480017955269
],
[
-95.8276033401489,
40.8437165147204
],
[
-95.8381175994873,
40.8437165147204
],
[
-95.840220451355,
40.8485861305308
],
[
-95.83451271057127,
40.85743168374378
]
]
]
}
}
],
"customer_field_id": "123456"
}
/api/farm_fields/[Farm Field ID]¶
PUT¶
Updates an existing farm field for the given farm field ID.
Parameters¶
This method requires a farm field ID in the URL and a farm field in the body of the request.
Returns¶
Returns the newly updated farm fields.
Sample¶
{
"id": 601916,
"grower": {
"id": 112619,
"grower_id": "TESTGROWER"
},
"center": {
"lat": 40.85057409923209,
"lng": -95.83350419998169
},
"crop": {
"id": 143,
"name": "-Unknown-"
},
"comments": "",
"adjacents_verified_by": null,
"fields": [
{
"name": "Fremont D1",
"actual_acres": 254.0,
"geom": {
"type": "Polygon",
"coordinates": [
[
[
-95.83451271057127,
40.85743168374378
],
[
-95.83030700683594,
40.85134542065296
],
[
-95.8267879486084,
40.8506961862558
],
[
-95.8288049697876,
40.8480017955269
],
[
-95.8276033401489,
40.8437165147204
],
[
-95.8381175994873,
40.8437165147204
],
[
-95.840220451355,
40.8485861305308
],
[
-95.83451271057127,
40.85743168374378
]
]
]
}
}
],
"customer_field_id": "123456"
}