Skip to content
Repository of sample scripts with which one consumes data from Agrimetrics' Data Platform
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
field-explorer-examples
.gitignore initial commit Aug 30, 2019
monthly_rainfall.png
readme.md
requirements.txt initial commit Aug 30, 2019

readme.md

Field Explorer Examples

This repository contains some examples of how to call Agrimetrics' Field Explorer APIs.

Pre-requisites:

  • Python 3.6+
  • a valid Field Explorer subscription key must be obtained and set in your environment as API_KEY.

To obtain your subscription key:

To setup your python environment, install the dependencies via:

> pip install -r requirements.txt

API Examples

For each API call made by these examples, a URL is printed which is suitable for pasting into another tool (e.g. a browser) to fetch the same results. Note that these URLs will contain your API key, and so should not be shared publically.

Field Facts, Forecasts and Trends APIs Example

This example does the following:

  • Calls Field Finder to return the ID for the field at a specified location
  • Calls Field Facts, Field Trends and Field Forecasts to return detailed information about that field
  • Parses the results and plots them on a series of graphs
  • Prints selected results in tabular format
python field-explorer-examples/field_explorer.py

Monthly Rainfall

Field Search API Example

This example does the following:

  • Calls Field Search to:
    • search an area for fields that grew wheat in 2018
    • return the soil and historical rainfall properties for matching fields
  • Parses the results and plots them on a series of graphs
  • Prints selected results in tabular format
python field-explorer-examples/field_search.py

Field Boundaries API Example

This example does the following:

  • Calls Field Boundaries to obtain all the boundaries for:
    • fields in an area defined by a shape, results as JSON
    • fields in an area defined by a centre point and radius, results as a GeoJSON FeatureCollection
    • a field with a known Agrimetrics field ID, results as GeoJSON
  • Collects all pages of results by making multiple calls to the API
  • Prints selected field ids and boundaries
python field-explorer-examples/field_boundaries.py

Further Reading

You can’t perform that action at this time.