xLocate2 Cyrillic vs Latin

deals with geocoding and reverse geocoding
Post Reply
RemcoZut
Posts: 3
Joined: Fri Dec 08, 2023 9:47 am

xLocate2 Cyrillic vs Latin

Post by RemcoZut »

We encounter a problem with the xServer2 XLocate responses on countries where cyrillic script is default.
The use-case:
SearchLocationRequest is invoked with mapLanguage with 'nl' (dutch) or other western languages.
When the requested language is not available in the map data the language of the country locality is used.
In case of requesting the Sparta in Greece this results in a western human unreadable cyrillic 'Σπάρτη'
A western Latin value was expected like 'Sparti'
To ensure latin script a workaround is implemented which checks the requested country and overrides the preferred mapLanguage when in certain cyrillic based countries with resp und-Latn-t-el, und-Latn-t-ru.
Unfortunately this workaround doesn't cover all types of requests, ie:
- a searchByText without allowedCountries specification
- a searchByPosition without allowedCountries specification (which definitely is the common way to be invoked, agree?)

An improvement in the xServer can be to have a switch in xserver.conf to enforce Latin script in the output

A related topic is viewtopic.php?t=1595

Kind regards,
Remco Zut | Locatienet bv
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate2 Cyrillic vs Latin

Post by Bernd Welter »

Hi Remco,

not sure what the request is about... you want to enforce a "latin" version of an output?

Code: Select all

{
  "$type":"SearchByTextRequest",
  "text": "Greece,Sparta",
  "requestProfile": {
      "mapLanguage": "nl"
  }
}

Code: Select all

{
  "$type":"SearchByTextRequest",
  "text": "Greece,Sparta",
  "requestProfile": {
      "mapLanguage": "und-Latn-t-el"
  }
}

Code: Select all

{
  "$type":"SearchByTextRequest",
  "text": "Greece,Sparta",
  "requestProfile": {
  }
}

Code: Select all

{
  "$type": "LocationsResponse",
  "results": [
    {
      "location": {
        "referenceCoordinate": {
          "x": 22.426630091,
          "y": 37.074611685
        },
        "address": {
          "country": "Griekenland",
          "state": "Πελοπόννησος",
          "province": "Λακωνία",
          "city": "Σπάρτη"
        },
        "formattedAddress": "Σπάρτη"
      },
      "matchQuality": {
        "totalScore": 100,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "city": 100
        }
      },
      "type": "LOCALITY"
    }
  ]
}

Code: Select all

{
  "$type": "LocationsResponse",
  "results": [
    {
      "location": {
        "referenceCoordinate": {
          "x": 22.426630091,
          "y": 37.074611685
        },
        "address": {
          "country": "Ellada",
          "state": "Peloponnisos",
          "province": "Lakonia",
          "city": "Sparti"
        },
        "formattedAddress": "Sparti"
      },
      "matchQuality": {
        "totalScore": 100,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "city": 100
        }
      },
      "type": "LOCALITY"
    }
  ]
}

Code: Select all

{
  "$type": "LocationsResponse",
  "results": [
    {
      "location": {
        "referenceCoordinate": {
          "x": 22.426630091,
          "y": 37.074611685
        },
        "address": {
          "country": "Ελλάδα",
          "state": "Πελοπόννησος",
          "province": "Λακωνία",
          "city": "Σπάρτη"
        },
        "formattedAddress": "Σπάρτη"
      },
      "matchQuality": {
        "totalScore": 100,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "city": 100
        }
      },
      "type": "LOCALITY"
    }
  ]
}
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:
RemcoZut
Posts: 3
Joined: Fri Dec 08, 2023 9:47 am

Re: xLocate2 Cyrillic vs Latin

Post by RemcoZut »

The mapLanguage of our requests is usually 'nl'

Code: Select all

{
  "$type": "SearchByTextRequest",
  "text": "Sparta",
  "requestProfile": {
    "mapLanguage": "nl"
  }
}
which results in Cyrillc Greek:

Code: Select all

{
  "$type": "LocationsResponse",
  "results": [
    {
      "location": {
        "referenceCoordinate": {
          "x": 22.426630091,
          "y": 37.074611685
        },
        "address": {
          "country": "Griekenland",
          "state": "Πελοπόννησος",
          "province": "Λακωνία",
          "city": "Σπάρτη"
        },
        "formattedAddress": "Σπάρτη"
      },
-----
}
This is not readable for the end-user. Thus a Latin version is needed as a fallback mapLanguage.
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate2 Cyrillic vs Latin

Post by Bernd Welter »

Hi Remco,

currently this is not possible. But we forwarded the requirement to product management.
Please get in touch with Joost/Kasper, too.

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:
RemcoZut
Posts: 3
Joined: Fri Dec 08, 2023 9:47 am

Re: xLocate2 Cyrillic vs Latin

Post by RemcoZut »

They are already informed
Post Reply