today a customer asked me how to geocode addresses within the region formerly known as Yugoslavia (YU, capital Belgrade).
In his data the country code is still YU and this doesn't work with the current ISO codes expected by the geocoding engine.
A simple text replacement isn't sufficient because the large region is now split into several countries / capitals:
Country | Capital | ISO2 |
---|---|---|
Slovenia | Ljubljana | SL |
Croatia | Zagreb | HR |
Bosnia and Herzegovina | Sarajevo | BA |
Serbia | Belgrade | RS |
Montenegro | Podgorica | ME |
Kosovo | Pristina | RS |
North Macedonia | Skopje | MK |
What I recommend if the input country code is "YU":
- Remove the input country code
- apply the search options: allowed countries with the set of the new countries. This will ensure that only such addresses are returned that are positioned within one of those countries. (hard filter)
Code: Select all
{
"$type": "SearchByAddressRequest",
"address": {
"postalCode": "",
"city": "Sarajevo",
"street": ""
},
"searchOptions": {
"allowedCountries": [
"SL",
"HR",
"BA",
"RS",
"ME",
"MK"
]
}
}
Bernd