Page 1 of 1

How to perform geocoding with YU addresses (Yugoslavia)

Posted: Tue Jan 11, 2022 12:09 pm
by Bernd Welter
Hi,

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:
CountryCapitalISO2
SloveniaLjubljanaSL
CroatiaZagrebHR
Bosnia and HerzegovinaSarajevoBA
SerbiaBelgradeRS
MontenegroPodgoricaME
KosovoPristinaRS
North MacedoniaSkopjeMK
Attention: Kosovo is still a disputed region. There's no "Kosovo"-ISO2 code in the engine, too.
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)
Sample request:

Code: Select all

{
  "$type": "SearchByAddressRequest",
  "address": {
    "postalCode": "",
    "city": "Sarajevo",
    "street": ""
  },
  "searchOptions": {
   "allowedCountries": [
      "SL",
      "HR",
      "BA",
      "RS",
      "ME",
      "MK"
    ]
  }
}
Best regards,
Bernd