In this repository, you will find sample codes to use Leaf API resources directly in ArcGIS products, such as ArcGIS Pro, ArcGIS Enterprise, and Experience Builder.
One of the ways to consume the data provided by the Leaf API in ArcGIS Pro is through toolboxes using arcpy.
In the ArcGIS Pro folder, you will find samples to handle the following data:
- Authentication with Leaf
- Connecting with Ag data providers using Magic Link
- Uploading machine data files using Magic Link
- Field Boundary Management
- Field Operations Management
- Crop Monitoring using Satellite images
This is a ready-to-use sample, you can use it directly in ArcGIS Pro. You will need a Leaf account to use it and you can create it here.
- Download the
Leaf Agriculture.atbxfile and move it to a desired folder; - Connect the folder with your Catalog and access it;
- Open the toolbox and start with the "Authenticate with Leaf" tool informing your Leaf credentials.
More details about the example tools are available in this tutorial.
To edit the files, you can follow this tutorial from the ArcGIS Pro documentation.
The code can be adjusted to suit your needs. Other Leaf products and more details about each endpoint and integrations can be found in our API tutorials and documentation, available here.
Another integration option is through Leaf Alerts via webhooks, which means Leaf can notify directly a geoprocessing published in your ArcGIS Enterprise.
The sample file contains a toolbox prepared to be published as geoprocessing.
- Open the
Leaf for Enterprise.atbxtoolbox in Pro; - Edit the example script to add the necessary information, and run the tool;
- After that, perform the geoprocessing publication procedures as described in the ArcGIS documentation.
A complete guide and the next steps for configuring the alert are available in this Leaf tutorial.
If you are using ArcGIS Experience Builder Developer Edition you can take advantage of Leaf's ready-to-use components through Leaf Link. These are widgets that can be easily adapted for use as ExB widgets.
Two options are available: using Leaf Link, which are widgets that can be embedded in your ExB widget, or Magic Link, which will require less code to get ready.
Here are the example details: