xLocate2 Cyrillic vs Latin
xLocate2 Cyrillic vs Latin
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
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
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: xLocate2 Cyrillic vs Latin
Hi Remco,
not sure what the request is about... you want to enforce a "latin" version of an output?
not sure what the request is about... you want to enforce a "latin" version of an output?
Code: Select all
|
Code: Select all
|
Code: Select all
|
Code: Select all
|
Code: Select all
| Code: Select all
|
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...
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...
Re: xLocate2 Cyrillic vs Latin
The mapLanguage of our requests is usually 'nl'
which results in Cyrillc Greek:
This is not readable for the end-user. Thus a Latin version is needed as a fallback mapLanguage.
Code: Select all
{
"$type": "SearchByTextRequest",
"text": "Sparta",
"requestProfile": {
"mapLanguage": "nl"
}
}
Code: Select all
{
"$type": "LocationsResponse",
"results": [
{
"location": {
"referenceCoordinate": {
"x": 22.426630091,
"y": 37.074611685
},
"address": {
"country": "Griekenland",
"state": "Πελοπόννησος",
"province": "Λακωνία",
"city": "Σπάρτη"
},
"formattedAddress": "Σπάρτη"
},
-----
}
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: xLocate2 Cyrillic vs Latin
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
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...
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...
Re: xLocate2 Cyrillic vs Latin
They are already informed
Re: xLocate2 Cyrillic vs Latin
Hi Bernd,
I want to actualize this issue.
For the geocoding request Valjevo in Servia with maplanguage Russian transliterated to latin alphabet (transformation subtag).
The response is still in cyrillic notation, and thus unreadable for western human :
I understand that this is because of the lack of availability, as stated in the documentation:
For example run this
At:
https://xserver2-europe-eu-test.cloud.p ... 257C_____1
Can you please tell me why the map is showing the city in correct latin and the geocoder doesn't
Kind regards,
Remco Zut
Locatienet
I want to actualize this issue.
For the geocoding request Valjevo in Servia with maplanguage Russian transliterated to latin alphabet (transformation subtag).
Code: Select all
{
"$type": "SearchByAddressRequest",
"address": {
"city": "Valjevo",
"country": "RS"
},
"requestProfile": {
"mapLanguage": "und-Latn-t-ru"
}
}
Code: Select all
{
"$type": "LocationsResponse",
"results": [
{
"location": {
"referenceCoordinate": {
"x": 19.890300695,
"y": 44.273788494
},
"address": {
"country": "Servia",
"state": "Централна Србија",
"province": "Колубарски Округ",
"city": "Ваљево"
},
"formattedAddress": "Ваљево"
},
"matchQuality": {
"totalScore": 100,
"addressScores": {
"country": 100,
"state": 0,
"province": 0,
"city": 100
}
},
"type": "LOCALITY"
}
]
}
But the map of Valjevo in Servia is showing the name of the city in latin correctly. So you may think the lating version should be available.It depends on the data whether or not texts are available in the requested language. If the requested language is not available for that item, the default text will be used
For example run this
Code: Select all
var map = new L.Map('map', { center: [44.273788494,19.890300695], zoom: 10 });
// Add a tile layer with the url pattern.
var tileUrl = xServerUrl + '/services/rest/XMap/tile/{z}/{x}/{y}';
new L.TileLayer(tileUrl, { minZoom: 1, maxZoom: 19}).addTo(map);
https://xserver2-europe-eu-test.cloud.p ... 257C_____1
Can you please tell me why the map is showing the city in correct latin and the geocoder doesn't
Kind regards,
Remco Zut
Locatienet
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: xLocate2 Cyrillic vs Latin
Hi Remco,
in the upcoming version of xLocate (v2.34, expected for mid/end of october) we will also support "x-ptv-Latn-DFT" which will then return the result as expected.
This value is already supported in PTV Developer:
returns:
in the upcoming version of xLocate (v2.34, expected for mid/end of october) we will also support "x-ptv-Latn-DFT" which will then return the result as expected.
This value is already supported in PTV Developer:
Code: Select all
{
"country": "RS", "state": "", "locality": "Valjevo",
"postalCode": "", "street": "", "houseNumber": "",
"countryFilter": null, "language": "x-ptv-Latn-DFT",
"results": [
"ADDRESS_SCORES"
]
}
Code: Select all
{
"locations": [
{
"locationType": "LOCALITY",
"referencePosition": {
"latitude": 44.273788452148438, "longitude": 19.890300750732422
},
"address": {
"countryName": "Srbija", "state": "Centralna Srbija",
"province": "Kolubarski Okrug", "postalCode": "",
"city": "Valjevo",
"district": "", "subdistrict": "",
"street": "", "houseNumber": "",
"countryCodeIsoAlpha2": "RS",
"countryCodeIsoAlpha3": "SRB"
},
"formattedAddress": "Valjevo",
"quality": {
"distance": null,
"totalScore": 100,
"addressScores": {
"country": 100,
"city": 100
}
}
}
]
}
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...
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...