Each result returned from Jawg Places contains several different properties to help you programmatically determine if a result is good enough for your purposes.
There are three possible values:
If Jawg Places found exactly what it believes you were looking for, the
match_type value will be
If Jawg Places determined you are querying for a street address, and could not find that exact address, but was able to estimate where that address might be (if it exists) via the interpolation engine, the match type will be
If Jawg Places wasn’t able to return exactly what it thinks you asked for, it will try to return something that relates to your query in an intelligent way. These fallback results will be records that follow the relationships of places in the real world.
A query for 1600 Pennsylvania Avenue, Seattle, Washington returns the city of Seattle, since there is no Pennsylvania Avenue in Seattle. In previous versions of Jawg Places, this query would return 1600 Pennsylvania Avenue addresses in other parts of the world (such as the famous White House address in Washington, D.C.).
A query for France will return one result, with
exact. However, a query for the non-existent city of Berlin, France will also return France, but in this case with a match type of
fallback. Jawg Places knows you were looking for something in the country of France called Berlin. It couldn’t find it, so instead of returning one of the many other Berlins, it returns France. This demonstrates that the
match_type value depends on the query and the result.
This is a general score computed to calculate how likely result is what was asked for. It’s meant to be a combination of all the information available to Jawg Places.
It’s not super sophisticated, and results may not be sorted in confidence-score order. In that case results returned first should be trusted more. Confidence scores are floating point numbers ranging from
Confidence scores are calculated differently for different endpoints:
For reverse geocoding it’s based on distance from the reverse geocoded point. The progression of confidence scores is as follows:
|< 1 meter||1.0|
|1 - 10 meters||0.9|
|11 - 100 meters||0.8|
|101 - 250 meters||0.7|
|251 - 1000 meters||0.6|
For forward geocoding and autocomplete, several factors affect the score. These factors are:
match_type, as described above
In all cases, confidence scores for
fallback results will be reduced.
This is essentially what type of result was returned, for example whether the result was an address, a city, or a country (a full list of possible layers can be found in the search endpoint documentation).
layers parameter can be used to filter out undesired results if you know ahead of time what you want.
Results that have a
layer value that you did not expect generally represent a fallback scenario, and should be checked carefully.
The accuracy field gives information on the accuracy of the latitude/longitude point returned with the given result. This value is a property of the result itself and won’t change based on the query. There are currently two possible values for the
point results are generally addresses, venues, or interpolated addresses. A point result means the record represents a record that can reasonably be represented by a single latitude/longitude point.
centroid results, on the other hand, are records that represent a larger area, such as a city or country. Jawg Places cannot currently return results with geometries made of polygons or lines, so all such records are estimated with a centroid.
In the future, Jawg Places will likely add support for proper complex geometries.