Skip to content

Commit 289d984

Browse files
Merge pull request #78473 from S-J-M/mobilityDocs
Mobility conceptual docs
2 parents 1a5a24d + be56285 commit 289d984

File tree

9 files changed

+1214
-7
lines changed

9 files changed

+1214
-7
lines changed

articles/azure-maps/how-to-render-custom-data.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: How to render custom data on a raster map in Azure Maps | Microsoft Docs
33
description: Render custom data on a raster map in Azure Maps.
44
author: walsehgal
55
ms.author: v-musehg
6-
ms.date: 02/12/2019
6+
ms.date: 04/03/2019
77
ms.topic: conceptual
88
ms.service: azure-maps
99
services: azure-maps
@@ -37,7 +37,7 @@ To render pushpins with labels and a custom image, complete these steps:
3737

3838
2. To create the request, select **New** again. In the **Create New** window, select **Request**. Enter a **Request name** for the pushpins, select the collection you created in the previous step as the location in which to save the request, and then select **Save**.
3939

40-
![Create a request in Postman](./media/tutorial-geofence/postman-new.png)
40+
![Create a request in Postman](./media/how-to-render-custom-data/postman-new.png)
4141

4242
3. Select the GET HTTP method on the builder tab and enter the following URL to create a GET request.
4343

@@ -140,7 +140,7 @@ You can also obtain the path and pin location information by using the [Data Upl
140140
https://atlas.microsoft.com/map/static/png?subscription-key={subscription-key}&api-version=1.0&layer=basic&style=main&zoom=12&center=-73.96682739257812%2C40.78119135317995&pins=default|la-35+50|ls12|lc003C62|co9B2F15||'Times Square'-73.98516297340393 40.758781646381024|'Central Park'-73.96682739257812 40.78119135317995&path=lc0000FF|fc0000FF|lw3|la0.80|fa0.30||udid-{udId}
141141
```
142142
143-
6. Here's the resulting image:
143+
Here's the response image:
144144
145145
![Get data from Azure Maps data storage](./media/how-to-render-custom-data/uploaded-path.png)
146146
@@ -159,9 +159,9 @@ You can modify the appearance of a polygon by using style modifiers with the [pa
159159
&subscription-key={subscription--key}
160160
```
161161
162-
Here's the resulting image:
162+
Here's the response image:
163163
164-
![Render an opaque polygon](./media/how-to-render-custom-data/opaque-polygon.png)
164+
![Render an opaque polygon](./media/how-to-render-custom-data/opaque-polygon.png)
165165
166166
167167
## Render a circle and pushpins with custom labels
@@ -181,9 +181,9 @@ Follow these steps to render a circle and pushpins with custom labels:
181181
https://atlas.microsoft.com/map/static/png?api-version=1.0&style=main&layer=basic&zoom=14&height=700&Width=700&center=-122.13230609893799,47.64599069048016&path=lcFF0000|lw2|la0.60|ra1000||-122.13230609893799 47.64599069048016&pins=default|la15+50|al0.66|lc003C62|co002D62||'Microsoft Corporate Headquarters'-122.14131832122801 47.64690503939462|'Microsoft Visitor Center'-122.136828 47.642224|'Microsoft Conference Center'-122.12552547454833 47.642940335653996|'Microsoft The Commons'-122.13687658309935 47.64452336193245&subscription-key={subscription-key}
182182
```
183183
184-
Here's the resulting image:
184+
Here's the response image:
185185
186-
![Render a circle with custom pushpins](./media/how-to-render-custom-data/circle-custom-pins.png)
186+
![Render a circle with custom pushpins](./media/how-to-render-custom-data/circle-custom-pins.png)
187187
188188
## Next steps
189189
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
---
2+
title: How to request real-time data in Azure Maps | Microsoft Docs
3+
description: Request real-time data using the Azure Maps Mobility service.
4+
author: walsehgal
5+
ms.author: v-musehg
6+
ms.date: 06/05/2019
7+
ms.topic: conceptual
8+
ms.service: azure-maps
9+
services: azure-maps
10+
manager: philmea
11+
ms.custom: mvc
12+
---
13+
14+
# Request real-time data using the Azure Maps Mobility Service
15+
16+
This article shows you how to use Azure Maps [Mobility Service](https://aka.ms/AzureMapsMobilityService) to request real-time transit data.
17+
18+
In this article you will learn how to:
19+
20+
21+
* Request next real-time arrivals for all lines arriving at the given stop
22+
* Request real-time information for a given bike docking station.
23+
24+
25+
## Prerequisites
26+
27+
To make any calls to the Azure Maps public transit APIs, you need a Maps account and key. For information on creating an account and retrieving a key, see [How to manage your Azure Maps account and keys](how-to-manage-account-keys.md).
28+
29+
This article uses the [Postman app](https://www.getpostman.com/apps) to build REST calls. You can use any API development environment that you prefer.
30+
31+
32+
## Request real-time arrivals for a stop
33+
34+
In order to request real-time arrivals data for a particular public transit stop, you will need to make a request to the [Real-time Arrivals API](https://aka.ms/AzureMapsMobilityRealTimeArrivals) of the Azure Maps [Mobility Service](https://aka.ms/AzureMapsMobilityService). You will need the **metroID** and **stopID** to complete the request. To learn more about how to request these parameters, see our How-to guide to [request public transit routes](https://aka.ms/AMapsHowToGuidePublicTransitRouting).
35+
36+
Let's use "522" as our metro ID, which is the metro ID for "Seattle–Tacoma–Bellevue, WA" area, and use the stop ID "2060603", which is a bus stop at "Ne 24th St & 162nd Ave Ne, Bellevue WA". To request next five real-time arrivals data for all next live arrivals at this stop, complete the following steps:
37+
38+
1. Create a collection in which to store the requests. In the Postman app, select **New**. In the **Create New** window, select **Collection**. Name the collection and select the **Create** button.
39+
40+
2. To create the request, select **New** again. In the **Create New** window, select **Request**. Enter a **Request name** for the request, select the collection you created in the previous step as the location in which to save the request, and then select **Save**.
41+
42+
![Create a request in Postman](./media/how-to-request-transit-data/postman-new.png)
43+
44+
3. Select the GET HTTP method on the builder tab and enter the following URL to create a GET request.
45+
46+
```HTTP
47+
https://atlas.microsoft.com/mobility/realtime/arrivals/json?subscription-key={subscription-key}&api-version=1.0&metroId=522&query=2060603&transitType=bus
48+
```
49+
50+
4. After a successful request, you will receive the following response. Notice that parameter 'scheduleType' defines whether the estimated arrival time is based on real-time or static data.
51+
52+
```JSON
53+
{
54+
"results": [
55+
{
56+
"arrivalMinutes": 4,
57+
"scheduleType": "realTime",
58+
"patternId": 3860436,
59+
"line": {
60+
"lineId": 2756599,
61+
"lineGroupId": 666063,
62+
"direction": "forward",
63+
"agencyId": 5872,
64+
"agencyName": "Metro Transit",
65+
"lineNumber": "226",
66+
"lineDestination": "Bellevue Transit Center Crossroads",
67+
"transitType": "Bus"
68+
},
69+
"stop": {
70+
"stopId": 2060603,
71+
"stopKey": "71300",
72+
"stopName": "NE 24th St & 162nd Ave NE",
73+
"position": {
74+
"latitude": 47.631504,
75+
"longitude": -122.125275
76+
},
77+
"mainTransitType": "Bus",
78+
"mainAgencyId": 5872,
79+
"mainAgencyName": "Metro Transit"
80+
}
81+
},
82+
{
83+
"arrivalMinutes": 30,
84+
"scheduleType": "scheduledTime",
85+
"patternId": 3860436,
86+
"line": {
87+
"lineId": 2756599,
88+
"lineGroupId": 666063,
89+
"direction": "forward",
90+
"agencyId": 5872,
91+
"agencyName": "Metro Transit",
92+
"lineNumber": "226",
93+
"lineDestination": "Bellevue Transit Center Crossroads",
94+
"transitType": "Bus"
95+
},
96+
"stop": {
97+
"stopId": 2060603,
98+
"stopKey": "71300",
99+
"stopName": "NE 24th St & 162nd Ave NE",
100+
"position": {
101+
"latitude": 47.631504,
102+
"longitude": -122.125275
103+
},
104+
"mainTransitType": "Bus",
105+
"mainAgencyId": 5872,
106+
"mainAgencyName": "Metro Transit"
107+
}
108+
}
109+
]
110+
}
111+
112+
113+
## Real-time availability and vacancy information for bike docking station
114+
115+
The [Get Transit Dock Info API](https://aka.ms/AzureMapsMobilityTransitDock) of the Azure Maps Mobility Service, allows to request static and real-time information for a given bike or scooter docking station. We will make a request to get real-time data for a docking station for bikes.
116+
117+
In order to make a request to the Get Transit Dock Info API, you will need the **dockId** for that station. You can get the dock ID by making a search request to the [Get Nearby Transit API](https://aka.ms/AzureMapsMobilityNearbyTransit) and setting the **objectType** parameter to "bikeDock". Follow the steps below to get real-time data of a docking station for bikes.
118+
119+
120+
### Get dock ID
121+
122+
To get **dockID**, follow the steps below to make a request to the Get Nearby Transit API:
123+
124+
1. In Postman, click **New Request** | **GET request** and name it **Get dock ID**.
125+
126+
2. On the Builder tab, select the **GET** HTTP method, enter the following request URL, and click **Send**.
127+
128+
```HTTP
129+
https://atlas.microsoft.com/mobility/transit/nearby/json?subscription-key={subscription-key}&api-version=1.0&metroId=121&query=40.7663753,-73.9627498&radius=100&objectType=bikeDock
130+
```
131+
132+
3. After a successful request, you will receive the following response. Notice that we now have the **id** in the response, which can be used later as a query parameter in the request to the Get Transit Dock Info API.
133+
134+
```JSON
135+
{
136+
"results": [
137+
{
138+
"id": "121---4640799",
139+
"type": "bikeDock",
140+
"objectDetails": {
141+
"availableVehicles": 0,
142+
"vacantLocations": 30,
143+
"lastUpdated": "2019-05-21T20:06:59-04:00",
144+
"operatorInfo": {
145+
"id": "80",
146+
"name": "Citi Bike"
147+
}
148+
},
149+
"position": {
150+
"latitude": 40.767128,
151+
"longitude": -73.962243
152+
},
153+
"viewport": {
154+
"topLeftPoint": {
155+
"latitude": 40.768039,
156+
"longitude": -73.963413
157+
},
158+
"btmRightPoint": {
159+
"latitude": 40.766216,
160+
"longitude": -73.961072
161+
}
162+
}
163+
}
164+
]
165+
}
166+
```
167+
168+
169+
### Get real-time bike dock status
170+
171+
Follow the steps below to make a request to the Get Transit Dock Info API to get real-time data for the selected dock.
172+
173+
1. In Postman, click **New Request** | **GET request** and name it **Get real-time dock data**.
174+
175+
2. On the Builder tab, select the **GET** HTTP method, enter the following request URL, and click **Send**.
176+
177+
```HTTP
178+
https://atlas.microsoft.com/mobility/transit/dock/json?subscription-key={subscription-key}&api-version=1.0&query=121---4640799
179+
```
180+
181+
3. After a successful request, you will receive a response of the following structure:
182+
183+
```JSON
184+
{
185+
"availableVehicles": 1,
186+
"vacantLocations": 29,
187+
"position": {
188+
"latitude": 40.767128,
189+
"longitude": -73.962246
190+
},
191+
"lastUpdated": "2019-05-21T20:26:47-04:00",
192+
"operatorInfo": {
193+
"id": "80",
194+
"name": "Citi Bike"
195+
}
196+
}
197+
```
198+
199+
200+
## Next steps
201+
202+
Learn how to request transit data using Mobility Service:
203+
204+
> [!div class="nextstepaction"]
205+
> [How to request transit data](how-to-request-transit-data.md)
206+
207+
Explore the Azure Maps Mobility Service API documentation:
208+
209+
> [!div class="nextstepaction"]
210+
> [Mobility Service API documentation](https://aka.ms/AzureMapsMobilityService)

0 commit comments

Comments
 (0)