Fix HERE GS7 metadata precision
This commit is contained in:
parent
46809cd760
commit
6dd18c40a8
@ -186,7 +186,7 @@ class HereMapsGeocoderV7(Traceable):
|
|||||||
]
|
]
|
||||||
|
|
||||||
PRECISION_BY_MATCH_TYPE = {
|
PRECISION_BY_MATCH_TYPE = {
|
||||||
'pointAddress': PRECISION_PRECISE,
|
'PA': PRECISION_PRECISE,
|
||||||
'interpolated': PRECISION_INTERPOLATED
|
'interpolated': PRECISION_INTERPOLATED
|
||||||
}
|
}
|
||||||
MATCH_TYPE_BY_MATCH_LEVEL = {
|
MATCH_TYPE_BY_MATCH_LEVEL = {
|
||||||
@ -323,7 +323,7 @@ class HereMapsGeocoderV7(Traceable):
|
|||||||
def _extract_metadata_from_result(self, result):
|
def _extract_metadata_from_result(self, result):
|
||||||
# See https://stackoverflow.com/questions/51285622/missing-matchtype-at-here-geocoding-responses
|
# See https://stackoverflow.com/questions/51285622/missing-matchtype-at-here-geocoding-responses
|
||||||
precision = self.PRECISION_BY_MATCH_TYPE.get(
|
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)
|
match_type = self.MATCH_TYPE_BY_MATCH_LEVEL.get(result.get('resultType'), None)
|
||||||
return geocoder_metadata(
|
return geocoder_metadata(
|
||||||
result['scoring']['queryScore'],
|
result['scoring']['queryScore'],
|
||||||
|
Loading…
Reference in New Issue
Block a user