Fix HERE GS7 metadata precision

This commit is contained in:
Miguel 2021-05-24 14:05:46 +02:00
parent 46809cd760
commit 6dd18c40a8

View File

@ -186,7 +186,7 @@ class HereMapsGeocoderV7(Traceable):
]
PRECISION_BY_MATCH_TYPE = {
'pointAddress': PRECISION_PRECISE,
'PA': PRECISION_PRECISE,
'interpolated': PRECISION_INTERPOLATED
}
MATCH_TYPE_BY_MATCH_LEVEL = {
@ -323,7 +323,7 @@ class HereMapsGeocoderV7(Traceable):
def _extract_metadata_from_result(self, result):
# See https://stackoverflow.com/questions/51285622/missing-matchtype-at-here-geocoding-responses
precision = self.PRECISION_BY_MATCH_TYPE.get(
result.get('resultType'), PRECISION_INTERPOLATED)
result.get('houseNumberType'), PRECISION_INTERPOLATED)
match_type = self.MATCH_TYPE_BY_MATCH_LEVEL.get(result.get('resultType'), None)
return geocoder_metadata(
result['scoring']['queryScore'],