Sample responses

Overview

This page shows and describes sample responses from Leaf API, along with a list of what properties you can expect for each type of data.

Operation Summary

Leaf returns operation file summaries in a standardized format. Summaries use the point data to derive basic information about the operation and include links to the original files and images of an operation. Naturally, different types of operations contain different properties. For instance, an applied operation will contain appliedRate, whereas a harvested operation will contain wetMass and other Yield properties. The resource below shows a typical return. A list of all properties is available here.

A list of the properties as well as a sample summary response for an operation file is included below.

An operation returned by Leaf can be an individual file or contain multiple individual files (uploaded, merged or uploaded). If the operation contains more than one individual file, another key is added to the resource, the "sources" key, that is a list of individual file ids. If the operation was created by an upload on the /batch endpoint, the "batchId" key will be added to the resource with the corresponding uuid.

Sample Summary response

You can move through the three tabs below to see a sample of how Leaf returns each of the operation types.

This is an example of a summary for a "harvested" operation

{
"id": "uuid",
"provider": "provider name",
"leafUserId": "uuid",
"apiOwnerUsername": "email",
"sourceFiles": [],
"status": "processed",
"origin": "provider or Leaf",
"machines": ["uuid"],
"createdTime": "2020-10-13T20:19:01",
"fields": ["uuid"],
"original": "abc.com",
"rawGeojson": "abc.com",
"standardGeojson": "abc.com",
"zippedPNGs": "abc.com",
"summary": {
"type": "Feature",
"properties": {
"elevation": {
"avg": 784.1533510349966,
"min": 779.62913693,
"max": 787.06455821,
"unit": "ft"
},
"harvestMoisture": {
"avg": 12.888719743652945,
"min": 1.0,
"max": 15.95,
"unit": "percentage"
},
"wetVolume": {
"avg": 0.04798510370695135,
"min": 5.321358838842975E-11,
"max": 0.348360994170295,
"unit": "bu"
},
"wetVolumePerArea": {
"avg": 77.48316026098765,
"min": 1.595E-7,
"max": 1666.6666666666667,
"unit": "bu/ac"
},
"totalWetMass": {
"value": 116805.33944346363,
"unit": "lb"
},
"wetMassPerArea": {
"avg": 4648.989615659259,
"min": 9.57E-6,
"max": 100000.0,
"unit": "lb/ac"
},
"totalWetVolume": {
"value": 1946.75565739101,
"unit": "bu"
},
"varieties": [
{
"harvestMoisture": {
"avg": 12.888719743652945,
"min": 1.0,
"max": 15.95,
"unit": "percentage"
},
"wetMass": {
"value": 116805.33944346363,
"unit": "lb"
},
"wetMassPerArea": {
"value": 1.1487903524141723,
"unit": "lb/ac"
},
"wetVolume": {
"value": 1946.75565739101,
"unit": "bu"
},
"area": {
"value": 101676.81091506233,
"unit": "m2"
},
"name": "variety"
}
],
"startTime": "2016-09-19T16:45:51.002Z",
"operationType": "harvested",
"originalOperationType": "name of the operation as returned by the provider",
"endTime": "2016-09-19T19:50:25.991Z",
"totalDistance": {
"value": 36481.33613821037,
"unit": "ft"
},
"wetMass": {
"avg": 2.8791062224170814,
"min": 3.192815303305785E-9,
"max": 20.9016596502177,
"unit": "lb"
},
"crop": [
"crop1"
],
"totalArea": {
"value": 101676.81091506233,
"unit": "m2"
}
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [[[
[-89.80434894561768,40.47791686563837],
[-89.80756759643555,40.4757623387113],
[-89.80746030807495,40.47302011353734],
[-89.80475664138794,40.47070219301965],
[-89.80080842971802,40.47068586935202],
[-89.79797601699828,40.472709973879255],
[-89.7978687286377,40.47569704893722],
[-89.80117321014404,40.47808008455794],
[-89.80434894561768,40.47791686563837]
]]]
}
}
}

Properties

Select the tab you want to see: "planted", "applied", "harvested", or "tillage".

keypresencetype
crop*string
seedRate*dict
operationType*string "planted"
originalOperationType**string
totalArea*float
elevation*dict
variety**string
seedRateTarget**dict
seedDepth**dict
machinery**list of machineInfo objects
speed**dict
totalPlanted**int (number of seeds)
operationDescription**string

* = Always in response
** = Usually in response but not required to pass tests

Standard Geojson

When the data is present in the original file, Leaf standardizes names and units to create the standardGeojson.

Below we list all the properties in the standardGeojson.

Sample Response

Each operation file returns with a "standardgeojson" URL that allows you to download a full point dataset from the operation in a standardized geojson format. Below is an example of the format of each point in these files.

{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-74.83762110788625, 28.686604864693564]
},
"properties": {
"distance": "float",
"heading": "float",
"speed": "float",
"elevation": "float",
"equipmentWidth": "float",
"recordingStatus": "string",
"machinery": ["string"],
"sectionId" : "int",
"timestamp": "string",
"operationType": "planted",
"originalOperationType": "name of the operation as returned by the provider",
"crop": "string",
"variety": "string",
"area": "float",
"seedRate": "int",
"seedRateTarget": "int",
"seedDepth": "float",
}
}

Properties

keypresencetypeexample unitsdescription
coords*Point (x,y)-Point (x,y)
timestamp*string-ISO 8601 date, complete and with Z. example: 2011-10-05T14:48:00.000Z
crop*string-Crop type (normalized)
area*floatft² or m²Area represented by point
heading*floatdegreesHeading of machine at point
distance*floatft or mDistance travelled since previous point
elevation*floatft or mDistance to sea level
operationType*string-string "planted"
originalOperationType**string-string
equipmentWidth*floatft or mWidth of implement
recordingStatus*Boolean-Recording status of machine at point
seedRate*intseeds/m² or seeds/acThe rate of seeds planted at point
variety**string-The variety of seed being planted
speed**floatft/s or m/sSpeed of machine at point
sectionId**int-ID of implement sensor section
machinery**list of machineInfo objects-name of machine & implement
seedRateTarget**intseeds/m² or seeds/acThe target rate of seeds to be planted at the point
seedDepth**floatcmThe depth at which seeds were planted at point
productIndex**int-Index of the applied product
xOffset**floatmVertical offset from the instrumentation sensor and the monitor GPS system
yOffset**floatmHorizontal offset from the instrumentation sensor and the monitor GPS system

* = Always in response
** = Usually in response but not required to pass tests
$ = Not available when the crop is sugarcane

Despite the example units, Leaf's API will push through every unit, if the processed file contains the required (marked with *) properties.

Valid points

The points in the standardGeoJSON are considered valid if all the following rules are true:

propertyrule
wetMass> 0.0
wetMassPerArea> 0.0
wetVolume> 0.0
wetVolumePerArea> 0.0
harvestMoisture> 0.0
appliedRate> 0.0
seedRate> 0.0
tillageDepthActual> 0.0
recordingStatus= "On"

If necessary Leaf API can automatically clean these points up using the configuration cleanupStandardGeojson.

Images

Also, Leaf displays all the numerical properties across all operation types via a png file. Here's a sample response from a Leaf harvested file.

{
"property": "area",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "wetMass",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "wetVolume",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "distance",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "wetVolumePerArea",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "equipmentWidth",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "wetMassPerArea",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "sectionId",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "elevation",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "harvestMoisture",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
},
{
"property": "heading",
"ramp": {
"0%": [200, 0, 0],
"35%": [255, 40, 0],
"45%": [255, 150, 0],
"55%": [255, 240, 0],
"65%": [0, 230, 0],
"75%": [0, 190, 0],
"100%": [0, 130, 0],
"nv": [0, 0, 0, 0 ]
},
"url": "https://png-files-bucket-dev.s3.us-east-1.amazonaws.com/uuid.png"
}
]