This article explains how to migrate the Bing Maps Geocode Dataflow API to Azure Maps Geocoding Batch and Reverse Geocoding Batch API. Azure Maps Geocoding Batch API is used to get latitude and longitude coordinates of a street address or name of a place in batch mode with a single API call. Azure Maps Geocoding Batchâ¯API is an HTTPâ¯POSTâ¯request that sends batches of queries to theâ¯Azure Maps Geocoding APIâ¯in a single request. Azure Maps Reverse Geocoding Batch API is used to translate latitude and longitude coordinates into a human understandable street address. Azure Maps Reverse Geocoding Batch API is an HTTPâ¯POST request that sends batches of queries to the Azure Maps Get Reverse Geocoding API in a single request.
PrerequisitesBing Maps for Enterprise only supports API key authentication. Azure Maps supports multiple ways to authenticate your API calls, such as a subscription key, Microsoft Entra ID, or Shared Access Signature (SAS) Token. For more information on security and authentication in Azure Maps, See Authentication with Azure Maps and the Security section in the Azure Maps Geocoding Batch documentation.
Request parametersThe following table lists the Bing Maps Geocode Dataflow request parameters and the Azure Maps equivalent:
Bing Maps Parameter Azure Maps Parameter Description dataLocation Not needed input Not needed Bing Maps Geocode Dataflow API supports XML and Text (csv, tab, and pipe delimited) format for the batch geocoding input data file. Azure Maps supports JSON format for the batch geocoding input data in the HTTP POST request. output Not needed Bing Maps Geocode Dataflow API supports JSON and XML for the batch geocode output data. Azure Maps supports JSON format for the batch geocoding output data.For more information about the Azure Maps URI parameters and request body, see the Azure Maps Geocoding Batch and Reverse Geocoding Batch documentation.
Bing Maps Data Schema 2.0 input and output comparison to Azure Maps Geocode Batch and Reverse Geocode Batch API:
Bing Maps Field Bing Maps Operation Azure Maps Field Azure Maps data type Description Address.AddressLine Geocode RequestFor more information about the Azure Maps Geocoding Batch response fields, see the response Definitions.
Request examplesBing Maps Geocode Dataflow API request:
http://spatial.virtualearth.net/REST/v1/Dataflows/Geocode?input=xml&key={BingMapsKey}
For examples that show sample input and output data for version 2.0 of the Geocode Dataflow, see Geocode Dataflow Sample Input and Output Data Version 2.0.
Azure Maps Geocoding Batch API request:
POST https://atlas.microsoft.com/geocode:batch?api-version=2023-06-01&subscription-key={Your-Azure-Maps-Subscription-key}
To send the geocoding queries, use an HTTP POST request where the body of the request contains the batchItems array in JSON format and the Content-Type header set to application/json.
The following JSON shows a sample request containing two geocoding queries, with one location in unstructured format and one location in structured format:
{
"batchItems": [
{
"addressLine": "One, Microsoft Way, Redmond, WA 98052",
"top": 2
},
{
"addressLine": "Pike Pl",
"adminDistrict": "WA",
"locality": "Seattle",
"top": 3
}
]
}
Sample Azure Maps Reverse Geocoding Batch API request:
POST https://atlas.microsoft.com/reverseGeocode:batch?api-version=2023-06-01&subscription-key={Your-Azure-Maps-Subscription-key}
To send the reverse geocoding queries, use an HTTP POST request where the body of the request contains a batchItems array in JSON format and the Content-Type header is set to application/json.
The following JSON shows a sample request containing two reverse geocoding queries:
{
"batchItems": [
{
"coordinates": [
-122.128275,
47.639429
],
"resultTypes": [
"Address",
"PopulatedPlace"
],
"optionalId": "4C3681A6C8AA4AC3441412763A2A25C81444DC8B"
},
{
"coordinates": [
-122.341979399674,
47.6095253501216
],
"optionalId": "6M9W39P12SNHGAIZ4JQ7F57NWJLV2BRYEQRD7OH7"
}
]
}
Response examples
A URL to download the geocode job results is provided when the Bing Maps Geocode Dataflow batch job processes successfully, as shown by the completed job status. For an example of a successful Bing Maps Geocode Dataflow output, see Geocode Dataflow Sample Input and Output Data Version 2.0 in the Bing Maps documentation.
The following sample shows what is returned in the body of the HTTP response when executing an Azure Maps Geocoding Batch API request:
{
"summary": {
"successfulRequests": 1,
"totalRequests": 2
},
"batchItems": [
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"type": "Address",
"confidence": "High",
"matchCodes": [
"Good"
],
"address": {
"locality": "Redmond",
"adminDistricts": [
{
"shortName": "WA"
},
{
"shortName": "King"
}
],
"countryRegion": {
"ISO": "US",
"name": "United States"
},
"postalCode": "98052",
"formattedAddress": "1 Microsoft Way, Redmond, WA 98052",
"addressLine": "1 Microsoft Way"
},
"geocodePoints": [
{
"geometry": {
"type": "Point",
"coordinates": [
-122.128275,
47.639429
]
},
"calculationMethod": "Rooftop",
"usageTypes": [
"Display",
"Route"
]
},
{
"geometry": {
"type": "Point",
"coordinates": [
-122.127028,
47.638545
]
},
"calculationMethod": "Rooftop",
"usageTypes": [
"Route"
]
}
]
},
"geometry": {
"type": "Point",
"coordinates": [
-122.128275,
47.639429
]
},
"bbox": [
-122.1359181505759,
47.63556628242932,
-122.1206318494241,
47.643291717570676
]
}
]
},
{
"error": {
"code": "Conflicting Parameters",
"message": "When 'query' is present, only the following parameters are valid: 'bbox, location, view, top'. 'addressLine' was passed"
}
}
]
}
The following sample shows what is returned in the body of the HTTP response when executing an Azure Maps Reverse Geocoding Batch API request:
{
"batchItems": [
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-122.1294081,
47.6391325
]
},
"properties": {
"geocodePoints": [
{
"geometry": {
"type": "Point",
"coordinates": [
-122.1294081,
47.6391325
]
},
"calculationMethod": "Rooftop",
"usageTypes": [
"Display"
]
}
],
"address": {
"addressLine": "15770 NE 31st St",
"adminDistricts": [
{
"shortName": "WA"
},
{
"shortName": "King Co."
}
],
"countryRegion": {
"name": "United States",
"iso": "US"
},
"locality": "Redmond",
"neighborhood": "Overlake",
"postalCode": "98052",
"formattedAddress": "15770 NE 31st St, Redmond, WA 98052, United States"
},
"confidence": "High",
"matchCodes": [
"Good"
],
"type": "Address"
},
"bbox": [
-122.13705120720665,
47.635269782429326,
-122.12176499279336,
47.64299521757068
]
}
]
},
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-122.341979399674,
47.6095253501216
]
},
"properties": {
"geocodePoints": [
{
"geometry": {
"type": "Point",
"coordinates": [
-122.341979399674,
47.6095253501216
]
},
"calculationMethod": "Interpolation",
"usageTypes": [
"Display",
"Route"
]
}
],
"address": {
"addressLine": "1736 Pike Pl",
"adminDistricts": [
{
"shortName": "WA"
},
{
"shortName": "King Co."
}
],
"countryRegion": {
"name": "United States",
"iso": "US"
},
"intersection": {
"baseStreet": "Pike Pl",
"displayName": "Pike Pl and Stewart St",
"intersectionType": "Near",
"secondaryStreet1": "Stewart St",
"secondaryStreet2": null
},
"locality": "Seattle",
"neighborhood": "Downtown Seattle",
"postalCode": "98101",
"formattedAddress": "1736 Pike Pl, Seattle, WA 98101, United States"
},
"confidence": "Medium",
"matchCodes": [
"Good"
],
"type": "Address"
},
"bbox": [
-122.34961817972945,
47.605662632550924,
-122.33434061961856,
47.61338806769228
]
}
]
}
],
"summary": {
"successfulRequests": 2,
"totalRequests": 2
}
}
Transactions usage
Similar to Bing Maps Geocode Dataflow API, Azure Maps Geocoding Batch and Reverse Geocoding Batch APIs log one billable transaction per geocoded item. For example, 100 locations geocoded in the batch request results in 100 billable transactions. For more information on Azure Maps transactions, see Understanding Azure Maps Transactions.
Additional informationMore Azure Maps Geocoding APIs
Support
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4