Fields

This endpoint facilitates management of user-defined field geometries. Once a field is defined, product endpoints may be invoked with its UUID to get field-specific results. Only the API account that defines a field can use and manage it.


Field List

GET /fields

Request Examples

See Headers for request header details.

$ curl -n -X GET https://agriculture.api.wdtinc.com/fields \
-H "Accept: application/vnd.wdt+json; version=1"

Response Example

See Status Codes for response code details.

HTTP/1.1 200 OK
[
  {
    "id": "b771141b-aa8b-44f3-a18a-3b29bb7579a2",
    "description": "My field in Oklahoma",
    "type": "GeometryCollection",
    "geometries": [
      {
        "type": "MultiPolygon",
        "coordinates": [
          [ [ [-97.1867, 35.0042], [-97.1785, 35.0042], [-97.1785, 35.0111], [-97.1867, 35.0111], [-97.1867, 35.0042] ] ]
        ]
      }
    ],
    "centroid": {
      "latitude": 35.009,
      "longitude": -97.164
    }
  },
  {
    "id": "062a6249-ccb7-468f-8ab4-fb817e95cf36",
    "description": "My field in Kansas",
    "type": "GeometryCollection",
    "geometries": [
      {
        "type": "MultiPolygon",
        "coordinates": [
          [ [ [-95.8460, 37.3168], [-95.8380, 37.3168], [-95.8380, 37.3229], [-95.8460, 37.3229], [-95.8460, 37.3168] ] ]
        ]
      }
    ],
    "centroid": {
      "latitude": 37.320,
      "longitude": -95.842
    }
  }
]

Field Information

GET /fields/{field-uuid}

Request Example

See Headers for request header details.

$ curl -n -X GET https://agriculture.api.wdtinc.com/fields/b771141b-aa8b-44f3-a18a-3b29bb7579a2 \
-H "Accept: application/vnd.wdt+json; version=1"

Response Example

See Status Codes for response code details.

HTTP/1.1 200 OK
{
  "id": "b771141b-aa8b-44f3-a18a-3b29bb7579a2",
  "description": "My field in Oklahoma",
  "type": "GeometryCollection",
  "geometries": [
    {
      "type": "MultiPolygon",
      "coordinates": [
        [ [ [-97.1867, 35.0042], [-97.1785, 35.0042], [-97.1785, 35.0111], [-97.1867, 35.0111], [-97.1867, 35.0042] ] ]
      ]
    }
  ],
  "centroid": {
    "latitude": 35.009,
    "longitude": -97.164
  }
}

Field Creation

POST /fields

Request Example

See Headers for request header details.

$ curl -n -X POST https://agriculture.api.wdtinc.com/fields \
-H "Accept: application/vnd.wdt+json; version=1" \
-H "Content-Type: application/json" \
-d '{
  "description": "My field in Missouri",
  "type": "GeometryCollection",
  "geometries": [
    {
      "type": "Polygon",
      "coordinates": [
        [ [-94.1902, 37.2464], [-94.1813, 37.2464], [-94.1813, 37.2537], [-94.1902, 37.2537], [-94.1902, 37.2464] ]
      ]
    }
  ]
}'

Response Example

See Status Codes for response code details.

HTTP/1.1 201 Created
{
  "id": "fe68c33d-e718-4449-acae-351072ce7749",
  "description": "My field in Missouri",
  "type": "GeometryCollection",
  "geometries": [
    {
      "type": "MultiPolygon",
      "coordinates": [
        [ [ [-94.1902, 37.2464], [-94.1813, 37.2464], [-94.1813, 37.2537], [-94.1902, 37.2537], [-94.1902, 37.2464] ] ]
      ]
    }
  ],
  "centroid": {
    "latitude": 37.250,
    "longitude": -94.186
  }
}

Field Update

PUT /fields/{field-uuid}

Request Example

See Headers for request header details.

$ curl -n -X PUT https://agriculture.api.wdtinc.com/fields/fe68c33d-e718-4449-acae-351072ce7749 \
-H "Accept: application/vnd.wdt+json; version=1" \
-H "Content-Type: application/json" \
-d '{
  "description": "My field in Missouri",
  "type": "GeometryCollection",
  "geometries": [
    {
      "type": "Polygon",
      "coordinates": [
        [ [-94.1902, 37.2464], [-94.1813, 37.2464], [-94.1813, 37.2537], [-94.1902, 37.2537], [-94.1902, 37.2464] ]
      ]
    }
  ]
}'

Response Example

See Status Codes for response code details.

HTTP/1.1 200 OK
{
  "id": "fe68c33d-e718-4449-acae-351072ce7749",
  "description": "My field in Missouri",
  "type": "GeometryCollection",
  "geometries": [
    {
      "type": "MultiPolygon",
      "coordinates": [
        [ [ [-94.1902, 37.2464], [-94.1813, 37.2464], [-94.1813, 37.2537], [-94.1902, 37.2537], [-94.1902, 37.2464] ] ]
      ]
    }
  ],
  "centroid": {
    "latitude": 37.250,
    "longitude": -94.186
  }
}

Field Removal

DELETE /fields/{field-uuid}

Request Example

See Headers for request header details.

$ curl -n -X DELETE https://agriculture.api.wdtinc.com/fields/fe68c33d-e718-4449-acae-351072ce7749 \
-H "Accept: application/vnd.wdt+json; version=1"

Response Example

See Status Codes for response code details.

HTTP/1.1 200 OK
{
  "id": "fe68c33d-e718-4449-acae-351072ce7749",
  "description": "My field in Missouri",
  "type": "GeometryCollection",
  "geometries": [
    {
      "type": "MultiPolygon",
      "coordinates": [
        [ [ [-94.1902, 37.2464], [-94.1813, 37.2464], [-94.1813, 37.2537], [-94.1902, 37.2537], [-94.1902, 37.2464] ] ]
      ]
    }
  ],
  "centroid": {
    "latitude": 37.250,
    "longitude": -94.186
  }
}