Reading a Geocoding Response
- A
MetaInfo
object that lists meta information about the request, such as theRequestId
,Timestamp
, and other additional data - A
View
object that groups search results, where theViewId
acts as a key to distinguish between different types of views - One or more
Result
objects containing the resulting items found along with attributes that determine the quality of the search result, such as:-
Relevance
– a value from 0 to 1 representing the percentage of the input that matched the returned address. "1" means that all input tokens were matched. -
Distance
– the distance, in meters, between the identified location object and the specified client position -
Direction
– the direction of the location object as seen from the specified client position measured clockwise in degrees starting with 0 at true north -
MatchLevel
– the most detailed address field that matches the geocoding or reverse geocoding query -
MatchQuality
– attribute level information about the match quality; always 1.0 for reverse geocode results -
MatchType
– quality of the location match, eitherpointAddress
orinterpolated
-
Location
– the location that was found, with theLocationId
,LocationType
,Address
and so on
-
Example response structure:
{"Response": {
"MetaInfo": {"Timestamp": "2016-11-09T10:17:23.943+0000"},
"View": [{
"_type": "SearchResultsViewType",
"ViewId": 0,
"Result": [{
"Relevance": 1,
"MatchLevel": "houseNumber",
"MatchQuality": {
"State": 1,
"City": 1,
"Street": [0.9],
"HouseNumber": 1
},
"MatchType": "pointAddress",
"Location": {
"LocationId": "NT_nL.dzNwdSJgdcF4U8dYEiC_yADM",
"LocationType": "point",
"DisplayPosition": {
"Latitude": 37.37634,
"Longitude": -122.03405
},
"NavigationPosition": [{
"Latitude": 37.37643,
"Longitude": -122.03444
}],
"MapView": {
"TopLeft": {
"Latitude": 37.3774642,
"Longitude": -122.0354646
},
"BottomRight": {
"Latitude": 37.3752158,
"Longitude": -122.0326354
}
},
"Address": {
"Label": "200 S Mathilda Ave, Sunnyvale, CA 94086, United States",
"Country": "USA",
"State": "CA",
"County": "Santa Clara",
"City": "Sunnyvale",
"District": "Heritage District",
"Street": "S Mathilda Ave",
"HouseNumber": "200",
"PostalCode": "94086",
"AdditionalData": [
{
"value": "United States",
"key": "CountryName"
},
{
"value": "California",
"key": "StateName"
},
{
"value": "Santa Clara",
"key": "CountyName"
},
{
"value": "N",
"key": "PostalCodeType"
}
]
}
}
}]
}]
}}