Skip to content

Commit 79fb2ce

Browse files
authored
Merge pull request #248414 from lbpudi/main
FarmOps CDMV2 changes
2 parents 30641c0 + 2d92813 commit 79fb2ce

17 files changed

+231
-86
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Working with Farm Activities data in Azure Data Manager for Agriculture
3+
description: Learn how to integrate with Farm Activities data providers and ingest data into ADMA
4+
author: lbpudi
5+
ms.author: lbethapudi
6+
ms.service: data-manager-for-agri
7+
ms.topic: conceptual
8+
ms.date: 08/14/2023
9+
ms.custom: template-concept
10+
---
11+
# Working with Farm Activities data in Azure Data Manager for Agriculture
12+
Farm Activities data is one of the most important ground truth datasets in precision agriculture. It's these machine-generated reports that preserve the record of what exactly happened where and when that is used to both improve in-field practice and the downstream values chain analytics cases
13+
14+
The Data Manager for Agriculture supports both
15+
* summary data - entered as properties in the operation data item directly
16+
* precision data - (for example, a .shp, .dat, .isoxml) uploaded as an attachment file and reference linked to the operation data item.
17+
18+
New operation data can be pushed into the service via the APIs for operation and attachment creation. Or, if the desired source is in the supported list of OEM connectors, data can be synced automatically from providers like Climate FieldView with a farm operation ingestion job.
19+
[!INCLUDE [public-preview-notice.md](includes/public-preview-notice.md)]
20+
* Azure Data Manager for Agriculture supports a range of Farm Activities data that can be found [here](/rest/api/data-manager-for-agri/#farm-activities)
21+
22+
## Integration with farm equipment manufacturers
23+
Azure Data Manager for Agriculture fetches the associated Farm Activities data (planting, application, tillage & harvest) from the data provider (Ex: Climate FieldView) by creating a Farm Activities data ingestion job. Look [here](./how-to-ingest-and-egress-farm-operations-data.md) for more details.
24+
25+
## Next steps
26+
27+
* Test our APIs [here](/rest/api/data-manager-for-agri).

articles/data-manager-for-agri/concepts-hierarchy-model.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ms.custom: template-concept
1515

1616
To generate actionable insights data related to growers, farms, and fields should be organized in a well defined manner. Firms operating in the agriculture industry often perform longitudinal studies and need high quality data to generate insights. Data Manager for Agriculture organizes agronomic data in the below manner.
1717

18-
:::image type="content" source="./media/data-model.png" alt-text="Screenshot showing farm hierarchy model.":::
18+
:::image type="content" source="./media/data-model-v-2.png" alt-text="Screenshot showing farm hierarchy model.":::
19+
:::image type="content" source="./media/management-zones.png" alt-text="Screenshot showing management zones.":::
1920

2021
## Understanding farm hierarchy
2122

@@ -28,25 +29,19 @@ To generate actionable insights data related to growers, farms, and fields shoul
2829
* Farms don't have any geometry associated with them. Farm entity helps you organize your growing operations. For example Contoso Inc is the Party that has farms in Oregon and Idaho.
2930

3031
### Field
31-
* Fields denote a stable boundary that is in general agnostic to seasons and other temporal constructs. For example, field could be the boundary denoted in government records.
32+
* Fields denote a stable geometry that is in general agnostic to seasons and other temporal constructs. For example, field could be the geometry denoted in government records.
3233
* Fields are multi-polygon. For example, a road might divide the farm in two or more parts.
33-
* Fields are multi-boundary.
3434

3535
### Seasonal field
3636
* This is the most important construct in the farming world. A seasonal fields definition includes the following things
37-
* Boundary
37+
* geometry
3838
* Season
3939
* Crop
4040
* A seasonal field is associated with a field or a farm
4141
* In Data Manager for Agriculture, seasonal fields are mono crop entities. In cases where farmers are cultivating different crops simultaneously, they have to create one seasonal field per crop.
4242
* A seasonal field is associated with one season. If a farmer cultivates across multiple seasons, they have to create one seasonal field per season.
4343
* It's multi-polygon. Same crop can be planted in different areas within the farm.
4444

45-
46-
### Boundary
47-
* Boundary represents the geometry of a field or a seasonal field.
48-
* It's represented as a multi-polygon GeoJSON consisting of vertices (lat/long).
49-
5045
### Season
5146
* Season represents the temporal aspect of farming. It is a function of local agronomic practices, procedures and weather.
5247

articles/data-manager-for-agri/concepts-ingest-satellite-imagery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Satellite imagery makes up a foundational pillar of agriculture data. To support
1717
* Read the Sinergise Sentinel Hub terms of service and privacy policy: https://www.sentinel-hub.com/tos/
1818
* Have your providerClientId and providerClientSecret ready
1919

20-
## Ingesting boundary-clipped imagery
20+
## Ingesting geometry-clipped imagery
2121
Using satellite data in Data Manager for Agriculture involves following steps:
2222

2323
:::image type="content" source="./media/satellite-flow.png" alt-text="Diagram showing satellite data ingestion flow.":::

articles/data-manager-for-agri/concepts-ingest-sensor-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In addition to the above approach, IOT devices (sensors/nodes/gateway) can direc
3838

3939
## Sensor topology
4040

41-
The following diagram depicts the topology of a sensor in Azure Data Manager for Agriculture. Each boundary under a party has a set of devices placed within it. A device can be either be a node or a gateway and each device has a set of sensors associated with it. Sensors send the recordings via gateway to the cloud. Sensors are tagged with GPS coordinates helping in creating a geospatial time series for all measured data.
41+
The following diagram depicts the topology of a sensor in Azure Data Manager for Agriculture. Each geometry under a party has a set of devices placed within it. A device can be either be a node or a gateway and each device has a set of sensors associated with it. Sensors send the recordings via gateway to the cloud. Sensors are tagged with GPS coordinates helping in creating a geospatial time series for all measured data.
4242

4343
:::image type="content" source="./media/sensor-topology-new.png" alt-text="Screenshot showing sensor topology.":::
4444

articles/data-manager-for-agri/concepts-isv-solutions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The solution framework is built on top of Data Manager for Agriculture that prov
3333

3434
Following are some of the examples of use cases on how an ISV partner could use the solution framework to build an industry specific solution.
3535

36-
* Yield Prediction Model: An ISV partner can build a yield model using historical data for a specific boundary and track periodic progress. The ISV can then enable forecast of estimated yield for the upcoming season.
36+
* Yield Prediction Model: An ISV partner can build a yield model using historical data for a specific geometry and track periodic progress. The ISV can then enable forecast of estimated yield for the upcoming season.
3737
* Carbon Emission Model: An ISV partner can estimate the amount of carbon emitted from the field based upon the imagery, sensors data for a particular farm.
3838
* Crop Identification: Use imagery data to identify crop growing in an area of interest.
3939

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Working with Farm Activities and in-field activity data in Azure Data Manager for Agriculture
3+
description: Learn how to manage Farm Activities data with manual and auto sync data ingestion jobs
4+
author: lbpudi
5+
ms.author: lbethapudi
6+
ms.service: data-manager-for-agri
7+
ms.topic: how-to
8+
ms.date: 08/14/2023
9+
ms.custom: template-how-to
10+
---
11+
# Working with Farm Activities and activity data in Azure Data Manager for Agriculture
12+
13+
Users can create a farm operation data ingestion job to **pull associated Farm Activities activity data** from a specified data provider into your Azure Data Manager for Agriculture instance, associated with a specific party. The job handles any required auth refresh, and by default detects and syncs any changes daily. In some cases, the job will also **pull farm and field** information associated with the given account into the party.
14+
15+
> [!NOTE]
16+
>
17+
>Before creating Farm Activities job, it is mandatory to successfully [**integrate with Farm Activities data provider oAuth flow**](./how-to-integrate-with-farm-ops-data-provider.md)
18+
>
19+
20+
## Create FarmOperations Job
21+
22+
Create a farm-operations job to ingest Farm Activity data with an ID of your choice. This job ID is used to monitor the status of the job using GET Farm Operations job.
23+
24+
API documentation:[FarmOperations_CreateDataIngestionJob](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/farm-operations/create-data-ingestion-job)
25+
26+
> [!NOTE]
27+
>`shapeType` and `shapeResolution` are provider specific attributes. If they aren't applicable to your provider, set the value to "None".
28+
29+
Based on the `startYear` and `operations` list provided, Azure Data Manager for Agriculture fetches the data from the start year to the current date.
30+
31+
Along with specific data (geometry), Farm Activities data provider also gives us the DAT file for the activity performed on your farm or field. The DAT file, Shape File etc. contain a geometry that reflects where the activity was performed.
32+
33+
Job status and details can be retrieved with: [FarmOperations_GetDataIngestionJobDetails](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/farm-operations/get-data-ingestion-job-details)
34+
35+
36+
## Finding and retrieving Farm Activities data
37+
38+
Now that the data is ingested into Azure Data Manager for Agriculture, it can be queried or listed with the following methods:
39+
40+
### Method 1: List data by type
41+
42+
Retrieved data is sorted by type under the party. These can be listed, with standard filters applied
43+
44+
[PlantingData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/planting-data/search)
45+
46+
[HarvestData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/harvest-data/search)
47+
48+
[ApplicationData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/application-data/search)
49+
50+
Individual data items may be retrieved to view the properties and metadata, including the `sourceActivityId`, `providerFieldId` and `Geometry`.
51+
52+
53+
[PlantingData_Get](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/planting-data/get)
54+
55+
[HarvestData_Get](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/harvest-data/get)
56+
57+
[ApplicationData_Get](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/application-data/get)
58+
59+
60+
### Method 2: search Farm Activities data using geometry intersect
61+
To account for the high degree of change found in field definitions, Azure Data Manager for Agriculture supports a search by intersect feature that allows you to organize data by space and time, without needing to first know the farm/field hierarchy or association.
62+
63+
64+
65+
[PlantingData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/planting-data/search)
66+
67+
68+
[HarvestData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/harvest-data/search)
69+
70+
[ApplicationData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/application-data/search)
71+
72+
You can also use the ID like `plantingId` to fetch the above data in the same API. if you remove the ID, you're able to see any other data that intersects with the same geometry across party. So it shows data for the same geometry across different parties.
73+
74+
## List and Download Attachments
75+
76+
The message attribute in the response of `FarmOperations_GetDataIngestionJobDetails` API shows how much data was processed and how many attachments were created. To check the attachments associated to the partyId, go to attachment API. The response gives you all the attachments created under the partyId.
77+
78+
API documentation: [Attachments](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/attachments)
79+
80+
## Next steps
81+
82+
* Understand our APIs [here](/rest/api/data-manager-for-agri).
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: How to integrate with Farm Activities data provider
3+
description: Learn how to integrate with Farm Activities data provider
4+
author: lbpudi
5+
ms.author: lbethapudi
6+
ms.service: data-manager-for-agri
7+
ms.topic: how-to
8+
ms.date: 08/14/2023
9+
ms.custom: template-how-to
10+
---
11+
12+
# Integrate with Farm Activities Data Provider
13+
Azure Data Manager for Agriculture supports connectors to conveniently sync your end-users' data from a range of farm machinery data sources. The setup involves **Configuring oAuth flow as a pre-requisite for integrating with any Farm Activities data provider**, along with a per-account, transparent consent step that handles initial and incremental data sync to keep the ADMA data estate up to date.
14+
15+
> [!NOTE]
16+
>
17+
> Steps 1 to 3 are part of the one-time-per-provider initial configuration. Once integrated, you will be able to enable all your end users to use the existing oAuth workflow and call the config API (Step 4) per user (PartyID) to retrieve the access token.
18+
19+
## Provider setup
20+
The example flow here uses Climate FieldView
21+
### Step 1: App Creation
22+
23+
If your application isn't already registered with Climate Fieldview, go to [FieldView portal](https://dev.fieldview.com/join-us/) and submit the form. Once FieldView processes your request, they send your `client_id` and `client_secret` which you'll use once per ADMA instance for FieldView.
24+
25+
### Step 2: Provider Configuration
26+
27+
Use the `oAuthProvider` API to create or update the oAuth provider (Ex: FIELDVIEW) with appropriate credentials of the newly created App.
28+
29+
API documentation: [oAuthProviders - Create Or Update](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/o-auth-providers/create-or-update)
30+
31+
32+
**Optional Step:** Once the operation is done, you can run the [oAuthProviders_Get](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/o-auth-providers/get) to verify whether the application is registered.
33+
Now, all the parties created in your Azure Data Manager for Agriculture instance can use FieldView as a provider to fetch Farm Activities data.
34+
35+
### Step 3: Endpoint Configuration
36+
37+
**User redirect endpoint**: This endpoint is where you want your users to be redirected to once the oAuth flow is completed. This endpoint will be generated by you and provided to ADMA as `userRedirectLink` in the oauth/tokens/:connect API.
38+
**Register the oAuth callback endpoint with your App on Climate FieldView portal.**
39+
## End-user account setup
40+
### Step 4: Party (End-user) Integration
41+
42+
When a party (end-user) lands on your webpage where the user action is expected (Ex: Connect to FieldView button), make a call to `oauth/tokens/:connect` API in the below fashion to get the oAuth provider's (Ex: Climate FieldView) sign-in uri back to start the end-user oAuth flow.
43+
44+
API documentation: [oAuthTokens - Get OAuth Connection Link](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/o-auth-tokens/get-o-auth-connection-link)
45+
46+
Once the `oauth/tokens/:connect` API successfully returns the `oauthAuthorizationLink`, **end-user clicks on this link to complete the oAuth flow** (Ex: For Climate FieldView, the user is served a FieldView access consent and sign-in page). Once the sign-in is completed, ADMA will redirect the user to the endpoint provided by customer (`userRedirectLink`) with the following query parameters in the url
47+
48+
1. **status** (success/failure)
49+
2. **state** (optional string to uniquely identify the user at customer end)
50+
3. **message** (optional string)
51+
4. **errorCode** (optional string sent for Failure/error) in the parameters.
52+
53+
> [!NOTE]
54+
>
55+
> If the API returns 404, then it implies the oAuth flow failed and ADMA could not acquire the access token.
56+
57+
### Step 5: Check Access Token Info (Optional)
58+
59+
This step is optional, only to confirm if for a given user or list of users, the required valid access token has been acquired or not. This can be done via making a call to the `oauth/tokens` API to **check for the entry `isValid: true` in the response body**.
60+
61+
API documentation: [oAuthTokens - List](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/o-auth-tokens/list)
62+
63+
**This step marks the successful completion of the oAuth flow for a user**. Now, the user is all-set to trigger a new [FarmOperationsDataJob](./how-to-ingest-and-egress-farm-operations-data.md) to start pulling the Farm Activities data from Climate FieldView.

0 commit comments

Comments
 (0)