You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3,7 +3,7 @@ title: 'Tutorial: Create a geofence and track devices on a Microsoft Azure Map'
3
3
description: Tutorial on how to set up a geofence. See how to track devices relative to the geofence by using the Azure Maps Spatial service
4
4
author: eriklindeman
5
5
ms.author: eriklind
6
-
ms.date: 02/28/2021
6
+
ms.date: 09/14/2023
7
7
ms.topic: tutorial
8
8
ms.service: azure-maps
9
9
services: azure-maps
@@ -23,7 +23,7 @@ Azure Maps provides services to support the tracking of equipment entering and e
23
23
> [!div class="checklist"]
24
24
>
25
25
> * Create an Azure Maps account with a global region.
26
-
> * Upload [Geofencing GeoJSON data] that defines the construction site areas you want to monitor. You'll use the [Data Upload API] to upload geofences as polygon coordinates to your Azure Maps account.
26
+
> * Upload [Geofencing GeoJSON data] that defines the construction site areas you want to monitor. You'll upload geofences as polygon coordinates to your Azure storage account, then use the [data registry] service to register that data with your Azure Maps account.
27
27
> * Set up two [logic apps] that, when triggered, send email notifications to the construction site operations manager when equipment enters and exits the geofence area.
28
28
> * Use [Azure Event Grid] to subscribe to enter and exit events for your Azure Maps geofence. You set up two webhook event subscriptions that call the HTTP endpoints defined in your two logic apps. The logic apps then send the appropriate email notifications of equipment moving beyond or entering the geofence.
29
29
> * Use [Search Geofence Get API] to receive notifications when a piece of equipment exits and enters the geofence areas.
@@ -61,32 +61,7 @@ The Azure CLI command [az maps account create] doesn’t have a location propert
61
61
62
62
This tutorial demonstrates how to upload geofencing GeoJSON data that contains a `FeatureCollection`. The `FeatureCollection` contains two geofences that define polygonal areas within the construction site. The first geofence has no time expiration or restrictions. The second can only be queried against during business hours (9:00 AM-5:00 PM in the Pacific Time zone), and will no longer be valid after January 1, 2022. For more information on the GeoJSON format, see [Geofencing GeoJSON data].
63
63
64
-
>[!TIP]
65
-
>You can update your geofencing data at any time. For more information, see [Data Upload API].
66
-
67
-
To upload the geofencing GeoJSON data:
68
-
69
-
1. In the Postman app, select **New**.
70
-
71
-
2. In the **Create New** window, select **HTTP Request**.
72
-
73
-
3. Enter a **Request name** for the request, such as *POST GeoJSON Data Upload*.
74
-
75
-
4. Select the **POST** HTTP method.
76
-
77
-
5. Enter the following URL. The request should look like the following URL:
The `geojson` parameter in the URL path represents the data format of the data being uploaded.
84
-
85
-
6. Select the **Body** tab.
86
-
87
-
7. In the dropdown lists, select **raw** and **JSON**.
88
-
89
-
8. Copy the following GeoJSON data, and then paste it in the **Body** window:
64
+
Create the geofence JSON file using the following geofence data. You'll upload this file into your Azure storage account next.
90
65
91
66
```JSON
92
67
{
@@ -174,74 +149,10 @@ To upload the geofencing GeoJSON data:
174
149
}
175
150
```
176
151
177
-
9. Select **Send**.
178
-
179
-
10. In the response window, select the **Headers** tab.
180
-
181
-
11. Copy the value of the **Operation-Location** key, which is the `status URL`. The `status URL` is used to check the status of the GeoJSON data upload.
7. In the response window, select the **Headers** tab.
208
-
209
-
8. Copy the value of the **Resource-Location** key, which is the `resource location URL`. The `resource location URL` contains the unique identifier (`udid`) of the uploaded data. Save the `udid` to query the Get Geofence API in the last section of this tutorial.
210
-
211
-
:::image type="content" source="./media/tutorial-geofence/resource-location-url.png" alt-text="Copy the resource location URL.":::
212
-
213
-
### (Optional) Retrieve GeoJSON data metadata
152
+
Follow the steps outlined in the [How to create data registry] article to upload the geofence JSON file into your Azure storage account then register it in your Azure Maps account.
214
153
215
-
You can retrieve metadata from the uploaded data. The metadata contains information like the resource location URL, creation date, updated date, size, and upload status.
216
-
217
-
To retrieve content metadata:
218
-
219
-
1. Select **New**.
220
-
221
-
2. In the **Create New** window, select **HTTP Request**.
222
-
223
-
3. Enter a **Request name** for the request, such as *GET Data Upload Metadata*.
224
-
225
-
4. Select the **GET** HTTP method.
226
-
227
-
5. Enter the `resource Location URL` you copied in [Check the GeoJSON data upload status]. The request should look like the following URL:
> Make sure to make a note of the unique identifier (`udid`) value, you will need it. The `udid` is is how you reference the geofence you uploaded into your Azure storage account from your source code and HTTP requests.
245
156
246
157
## Create workflows in Azure Logic Apps
247
158
@@ -592,22 +503,21 @@ There are no resources that require cleanup.
0 commit comments