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
Azure Maps [Search service][Search service v1] includes API that offers various capabilities to help developers to search addresses, places, business listings by name or category, and other geographic information. For example, [Search Fuzzy] allows users to search for an address or Point of Interest (POI).
19
19
20
-
This article explains how to apply sound practices when you call data from Azure Maps Search service. You'll learn how to:
20
+
This article explains how to apply sound practices when you call data from Azure Maps Search service. Learn how to:
21
21
> [!div class="checklist"]
22
22
>
23
23
> * Build queries to return relevant matches
@@ -36,7 +36,7 @@ You can use any API development environment such as [Bruno] to run the HTTP requ
36
36
37
37
When you search for a full or partial address by using Azure Maps Search service, the API reads keywords from your search query. Then it returns the longitude and latitude coordinates of the address. This process is called *geocoding*.
38
38
39
-
The ability to geocode in a country/region depends on the availability of road data and the precision of the geocoding service. For more information about Azure Maps geocoding capabilities by country or region, see [Geocoding coverage].
39
+
The ability to geocode in a country/region depends on the availability of road data and the precision of the geocoding service. For more information about Azure Maps geocoding capabilities by country/region, see [Geocoding coverage].
40
40
41
41
### Limit search results
42
42
@@ -67,8 +67,8 @@ We recommend that you use [Search Fuzzy] when you don't know your user inputs fo
67
67
68
68
*`Addr` - **Address ranges**: Address points that are interpolated from the beginning and end of the street. These points are represented as address ranges.
69
69
*`Geo` - **Geographies**: Administrative divisions of land. A geography can be a country/region, state, or city, for example.
70
-
*`PAD` - **Point addresses**: Addresses that include a street name and number. Point addresses can be found in an index. An example is *Soquel Dr 2501*. A point address provides the highest level of accuracy available for addresses.
71
-
*`POI` - **Points of interest**: Points on a map that are considered to be worth attention or that might be interesting. [Search Address] doesn't return POIs.
70
+
*`PAD` - **Point addresses**: Addresses that include a street name and number. Point addresses can be found in an index. An example is *Soquel Dr 2501*. A point address provides the highest level of accuracy available for addresses.
71
+
*`POI` - **Points of interest**: Points on a map that are considered to be worth attention or that might be interesting. [Search Address] doesn't return POIs.
72
72
*`Str` - **Streets**: Streets on the map.
73
73
*`XStr` - **Cross streets or intersections**: Junctions or places where two streets intersect.
Use the `language` parameter to set the language for the returned search results. If the request doesn't set the language, then by default Search service uses the most common language in the country or region. When no data is available in the specified language, the default language is used.
128
+
Use the `language` parameter to set the language for the returned search results. If the request doesn't set the language, then by default Search service uses the most common language in the country/region. When no data is available in the specified language, the default language is used.
129
129
130
130
For more information, see [Azure Maps supported languages].
131
131
132
132
### Use predictive mode (automatic suggestions)
133
133
134
-
To find more matches for partial queries, set the `typeahead` parameter to `true`. This query is interpreted as a partial input, and the search enters predictive mode. If you don't set the `typeahead` parameter to `true`, then the service assumes that all relevant information has been passed in.
134
+
To find more matches for partial queries, set the `typeahead` parameter to `true`. This query is interpreted as a partial input, and the search enters predictive mode. If you don't set the `typeahead` parameter to `true`, then the service assumes that all relevant information was passed in.
135
135
136
136
In the following sample query, the Search Address service is queried for *Microsoft*. Here, the `typeahead` parameter set to `true`. The response shows that the search service interpreted the query as partial query. The response contains results for an automatically suggested query.
***Point Address**: Points on a map that have a specific address with a street name and number. Point Address provides the highest level of accuracy for addresses.
769
769
770
-
***Address Range**: The range of address points that are interpolated from the beginning and end of the street.
770
+
***Address Range**: The range of address points that are interpolated from the beginning and end of the street.
771
771
772
772
***Geography**: Areas on a map that represent administrative divisions of a land, for example, country/region, state, or city.
773
773
@@ -785,7 +785,7 @@ Let's look at the response structure. In the response that follows, the types of
785
785
* Street
786
786
* Cross Street
787
787
788
-
Notice that the address search doesn't return POIs.
788
+
Notice that the address search doesn't return POIs.
789
789
790
790
The `Score` parameter for each response object indicates how the matching score relates to the scores of other objects in the same response. For more information about response object parameters, see [Get Search Address].
791
791
@@ -951,9 +951,9 @@ The `Score` parameter for each response object indicates how the matching score
951
951
952
952
### Geometry
953
953
954
-
A response type of *Geometry* can include the geometry ID that's returned in the `dataSources` object under `geometry` and `id`. For example, you can use the [Search Polygon service] to request the geometry data in a GeoJSON format. By using this format, you can get a city or airport outline for a set of entities. You can then use this boundary data to [Set up a geofence] or [Search POIs inside the geometry].
954
+
A response type of *Geometry* can include the geometry ID returned in the `dataSources` object under `geometry` and `id`. For example, you can use the [Search Polygon service] to request the geometry data in a GeoJSON format. By using this format, you can get a city or airport outline for a set of entities. You can then use this boundary data to [Set up a geofence] or [Search POIs inside the geometry].
955
955
956
-
Responses for [Search Address] or the [Search Fuzzy] can include the geometry ID that's returned in the `dataSources` object under `geometry` and `id`:
956
+
Responses for [Search Address] or the [Search Fuzzy] can include the geometry ID returned in the `dataSources` object under `geometry` and `id`:
957
957
958
958
```JSON
959
959
"dataSources": {
@@ -990,7 +990,7 @@ You can use any API development environment such as [Bruno] to run the HTTP requ
990
990
991
991
### Task‑specific operations
992
992
993
-
Each Search capability is exposed through a dedicated API, such as [Get Geocoding], [Get Geocode Autocomplete], [Get Reverse Geocoding] or [Get Polygon]. This separation improves clarity, performance, and intent alignment.
993
+
Each Search capability is exposed through a dedicated API, such as [Get Geocoding], [Get Geocode Autocomplete], [Get Reverse Geocoding], or [Get Polygon]. This separation improves clarity, performance, and intent alignment.
994
994
995
995
### Geographic relevance signals
996
996
@@ -1022,10 +1022,10 @@ This section describes practical techniques to reduce low‑quality matches for
1022
1022
1023
1023
* Confidence (High, Medium, Low). For more information, see [ConfidenceEnum].
1024
1024
* Match codes (Good, Ambiguous, UpHierarchy). For more information, see [MatchCodesEnum].
1025
-
* Result type (properties.type — for example: Address, PopulatedPlace, RoadBlock, AdminDivision1). For more information, see [properties.type].
1025
+
* Result type (`properties.type` for example: Address, PopulatedPlace, RoadBlock, AdminDivision1). For more information, see [properties.type].
1026
1026
1027
1027
> [!NOTE]
1028
-
> `RoadBlock` is formally listed as a possible [properties.type] value and is also referenced in [match‑code][MatchCodesEnum] documentation as an example of an `UpHierarchy` fallback. Treat it as a signal that the service could not resolve the query to a more specific street‑level address.
1028
+
> `RoadBlock` is formally listed as a possible [properties.type] value and is also referenced in [match‑code][MatchCodesEnum] documentation as an example of an `UpHierarchy` fallback. Treat it as a signal that the service couldn't resolve the query to a more specific street‑level address.
1029
1029
1030
1030
#### Prefer structured parameters when you know the address components
1031
1031
@@ -1068,22 +1068,22 @@ This reduces the likelihood of low-confidence matches in unrelated regions when
1068
1068
1069
1069
[Get Geocoding] returns multiple signals under features[].properties, including `confidence`, `matchCodes`, and `type`. Use these together rather than filtering by `confidence` alone.
1070
1070
1071
-
##### Why confidence alone is not sufficient
1071
+
##### Why confidence alone isn't sufficient
1072
1072
1073
1073
***Medium** confidence can indicate a valid result when the query is ambiguous and there isn't enough context to rank one candidate over another.
1074
1074
1075
-
***Medium** confidence can also occur when the service returns a less precise match than requested, and sets the match code to UpHierarchy (for example, matching only a postal code when an address was requested).
1075
+
***Medium** confidence can also occur when the service returns a less precise match than requested, and sets the match code to `UpHierarchy` (for example, matching only a postal code when an address was requested).
1076
1076
1077
1077
##### Reworded clarity: how "up-hierarchy" results happen
1078
1078
1079
-
When the service cannot find a match at the specificity implied by the query, it may "move up the geographic hierarchy" and return a broader location (for example, city, administrative division, or country/region). In those cases, matchCodes includes UpHierarchy, and properties.type indicates what level was actually returned.
1079
+
When the service can't find a match at the specificity implied by the query, it may "move up the geographic hierarchy" and return a broader location (for example, city, administrative division, or country/region). In those cases, `matchCodes` includes `UpHierarchy`, and properties.type indicates what level was returned.
1080
1080
1081
1081
##### Practical filtering guidance (apply in this order)
1082
1082
1083
1083
1.**Reject low-quality matches for exact-search UX**
1084
1084
If `confidence` is Low, treat the result as not acceptable for an exact-match workflow.
1085
1085
1.**Detect up-hierarchy fallbacks**
1086
-
If `matchCodes` includes `UpHierarchy`, the service could not match the requested granularity and returned a broader location. Use `type` to determine what level was returned (for example, `PopulatedPlace`, `AdminDivision1`, `CountryRegion`, or `RoadBlock`).
1086
+
If `matchCodes` includes `UpHierarchy`, the service couldn't match the requested granularity and returned a broader location. Use `type` to determine what level was returned (for example, `PopulatedPlace`, `AdminDivision1`, `CountryRegion`, or `RoadBlock`).
1087
1087
1.**Validate the expected result type**
1088
1088
If your UX expects a street-level match, accept results only when type is sufficiently specific (for example, Address) and reject broader types (for example, `PopulatedPlace`). This prevents accepting a city/state fallback when the user intended a specific address.
1089
1089
1.**Handle ambiguity explicitly**
@@ -1092,6 +1092,40 @@ When the service cannot find a match at the specificity implied by the query, it
1092
1092
> [!TIP]
1093
1093
> Use [properties.type] to understand what was returned and [matchCodes][MatchCodesEnum] to understand how it was derived (for example, `UpHierarchy` fallback).
1094
1094
1095
+
### Use geocoding as a data enrichment step
1096
+
1097
+
When geocoding large address datasets, expect that some records won't return results. This is normal and doesn't indicate a service error.
1098
+
1099
+
Common causes include:
1100
+
1101
+
* Misspellings or inconsistent formatting
1102
+
* Incomplete addresses
1103
+
* Interior details (for example, apartment, suite, or floor numbers) that aren't part of a deliverable address
1104
+
1105
+
Treat geocoding as a data enrichment process rather than a strict validation step:
1106
+
1107
+
* Submit addresses for geocoding.
1108
+
* Identify records that aren't resolved.
1109
+
* Flag unresolved addresses for review or normalization.
1110
+
* Retry geocoding only after cleaning the source data.
1111
+
1112
+
Avoid attempting to force matches for low‑quality input, as this can introduce incorrect or misleading location data into downstream systems.
1113
+
1114
+
### Understand empty geocoding results
1115
+
1116
+
A geocoding request may return an HTTP 200 (OK) response with no results.
1117
+
1118
+
This indicates that the request was processed successfully, but no matching address or place was found. It doesn't represent a failure of the service.
1119
+
1120
+
Applications should handle empty results explicitly and avoid treating them as errors. In many scenarios, returning no result is preferable to returning a low‑confidence or incorrect match.
1121
+
1122
+
> [!NOTE]
1123
+
> Azure Maps request limits, quotas, and throttling behavior are configured at the Azure subscription level.
1124
+
> For information on pricing, usage limits, and monitoring, see:
1125
+
>
1126
+
> *[Azure Maps pricing]
1127
+
> *[Understanding Azure Maps transactions]
1128
+
1095
1129
## Best practices for autocomplete
1096
1130
1097
1131
Use [Get Geocode Autocomplete] for interactive user input scenarios.
@@ -1118,7 +1152,7 @@ Use [Get Reverse Geocoding] to translate coordinates into a human‑readable add
1118
1152
Recommendations:
1119
1153
1120
1154
* Prefer batch reverse geocoding for telemetry, tracking, or other high‑volume workloads.
1121
-
* Cache results and avoid repeated calls for coordinates that do not change.
1155
+
* Cache results and avoid repeated calls for coordinates that don't change.
1122
1156
* Validate coordinate order and precision to ensure accurate and consistent results.
1123
1157
* Expect approximate or partial addresses in some locations and handle these cases gracefully.
1124
1158
@@ -1240,3 +1274,5 @@ GET https://atlas.microsoft.com/polygon
0 commit comments