Skip to content

Commit

Permalink
Add missing name for CN to the geocoder workarounds list #2670
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed May 5, 2022
1 parent 3e59b7f commit a44387c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geocoding/location-service/src/app/geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ def getISO3166Code(self, countryName):
# workaround a common problem: "United States" is the Mapbox name for US, but the algorithm
# below will also find UM (United States Minor Outlying Islands) and fail because the
# query is ambiguous.
#
# additionally the PRC is not in the iso3166 list (but China is).
fixups = {
'united states': 'US'
'united states': 'US',
"people's republic of china": 'CN'
}
name = countryName.lower()
if fixedCode := fixups.get(name):
Expand Down

0 comments on commit a44387c

Please sign in to comment.