How to perform geocoding with YU addresses (Yugoslavia)

deals with geocoding and reverse geocoding
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to perform geocoding with YU addresses (Yugoslavia)

Post 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
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply