xLocate - Ergebnis verbessern

deals with geocoding and reverse geocoding in the context of PTV Geocoding&Places, PTV Geocoding&Places OSM and PTV xLocate 1 and 2
clvo
Posts: 6
Joined: Thu Jun 02, 2022 7:42 am

xLocate - Ergebnis verbessern

Post by clvo »

Hallo zusammen,
gibt es eine Möglichkeit, die Qualität des Ergebnisses des Geocoders über gewisse Parameter zu verbessern?
Wir haben einige Beispiele, bei denen die Qualität der Adresse eigentlich sehr gut ist, aber xLocate leider falsche Ergebnisse liefert.

Konkretes Beispiel:

countryCode: RS
city: BEOGRAD
postalCode: 11000
streetAndNumber: 26 DUKATSKA

... liefert ...

countryCode: RS
city: Mladenovac
postalCode: 11400
streetAndNumber: Ulica Dunavska 26

Falsche Postleitzahl, falsche Stadte, falsche Straße.

Ich vermute mal, dass es an "schlechtem" Kartenmaterial liegt, aber evt. gibt es doch eine Mölgichkeit per Parametrierbarkeit?

Vielen Dank!
Schöne Grüße,
Claus Vogelmann
User avatar
Bernd Welter
Site Admin
Posts: 2684
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate - Ergebnis verbessern

Post by Bernd Welter »

Hello Claus,

please be aware that the one and only language in the forum is english.

The XLocate 1 API offers various search options you can use to control the handling of the geocoding via findAddress. I used the default settings of the engine to perform a search for the sample address both on TOMTOM and HERE and in both cases I get proper hits:
left: TOMTOM map<br />right: HERE map
left: TOMTOM map
right: HERE map
The design of the xLocate2 tries to minimize the amount of potential parameters because these lead to too many discussions in the past. The API v2 tries to ensure that the desired address is at least part of the result. Users can then easily use the additional output properties to sort and filter the result list.

Maybe you can send your exact sample request to us and we can analyse what went wrong in this specific case?

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:
clvo
Posts: 6
Joined: Thu Jun 02, 2022 7:42 am

Re: xLocate - Ergebnis verbessern

Post by clvo »

Hi Bernd,
oh sorry, for writing in german...
The exact sample request in json-format:

Code: Select all

{
	"address": {
		"country": "RS",
		"state": null,
		"province": null,
		"postalCode": "11000",
		"city": "BEOGRAD",
		"district": null,
		"subdistrict": null,
		"street": "BRAĆE LUKIĆA 78",
		"houseNumber": null
	},
	"searchOptions": {
		"allowedCountries": [
			"RS"
		],
		"outputCountryType": 1,
		"outputCountryTypeSpecified": true
	},
	"requestProfile": null,
	"geometryOptions": null,
	"timeouts": null,
	"userLogs": null,
	"scope": null,
	"storedProfile": null,
	"coordinateFormat": null
}
Is this format ok or do you need it in a different way?
Thanks in advance!
BR Claus
User avatar
Bernd Welter
Site Admin
Posts: 2684
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate - Ergebnis verbessern

Post by Bernd Welter »

HI Claus,

I made some manual adaptions to the xLocate2.SearchByAddress-request:

Code: Select all

{
  "$type":"SearchByAddressRequest",
   "address": {
      "country": "RS",
      "state": null,
      "province": null,
      "postalCode": "11000",
      "city": "BEOGRAD",
      "district": null,
      "subdistrict": null,
      "street": "BRAĆE LUKIĆA 78",
      "houseNumber": null
   },
   "searchOptions": {
      "allowedCountries": [
         "RS"
      ],
      "outputCountryType": "ISO_3166_1_ALPHA_2"   
   },
   "requestProfile": {
     "mapLanguage":"de"
   },
   "geometryOptions": null,
   "timeouts": null,
   "userLogs": null,
   "scope": null,
   "storedProfile": null,
   "coordinateFormat": null
}
which returns

Code: Select all

{
  "$type": "LocationsResponse",
  "results": [
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.540767708,
          "y": 44.814464597
        },
        "roadAccessCoordinate": {
          "x": 20.540670388,
          "y": 44.814521769
        },
        "address": {
          "country": "RS",
          "state": "Централна Србија",
          "province": "Град Београд",
          "postalCode": "11060",
          "city": "Belgrad",
          "district": "Палилула",
          "street": "Улица Драгана Лукића",
          "houseNumber": "78"
        },
        "formattedAddress": "Улица Драгана Лукића 78, 11060 Belgrad"
      },
      "matchQuality": {
        "totalScore": 76.3703704,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 60,
          "city": 100,
          "district": 0,
          "street": 33.333333333333336,
          "houseNumber": 100
        }
      },
      "type": "INTERPOLATED_ADDRESS"
    },
    /// and more
   ]
}
As this is a xLocate2 request the number of parameters is quite limited ;-)
  • allowedCountries: specifies the region to all potential hits have to be located in (like a search filter)
  • outputCountryType: changes the output format of the hit's country property (no impact on amount of hits and their locations)
  • mapLanguage: this would translate parts of the result into a specific language (e.g. German) if a translation is available in the database. The only part in the response that is translated is the city name BELGRAD.
What confuses me:
your initial request mentions a different sample address. Even that one is perfectly matched with my sample request. Is that info sufficient?

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:
User avatar
Bernd Welter
Site Admin
Posts: 2684
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate - Ergebnis verbessern

Post by Bernd Welter »

Update:

Use "mapLanguage":"und-Latn-t-sr" and you get the results in latin transcript... instead of cyrillic)

Code: Select all

{
  "$type": "LocationsResponse",
  "results": [
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.540767708,
          "y": 44.814464597
        },
        "roadAccessCoordinate": {
          "x": 20.540670388,
          "y": 44.814521769
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11060",
          "city": "Beograd",
          "district": "Palilula",
          "street": "Ulica Dragana Lukica",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Dragana Lukica 78, 11060 Beograd"
      },
      "matchQuality": {
        "totalScore": 76.3703704,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 60,
          "city": 100,
          "district": 0,
          "street": 33.333333333333336,
          "houseNumber": 100
        }
      },
      "type": "INTERPOLATED_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.450397457,
          "y": 44.813945731
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11000",
          "city": "Beograd",
          "district": "Savski Venac",
          "street": "Ulica Brace Krsmanovic"
        },
        "formattedAddress": "Ulica Brace Krsmanovic, 11000 Beograd"
      },
      "matchQuality": {
        "totalScore": 75.8101852,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 100,
          "city": 100,
          "district": 0,
          "street": 25
        }
      },
      "type": "STREET"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.45087054,
          "y": 44.81214147
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11000",
          "city": "Beograd",
          "district": "Savski Venac",
          "street": "Ulica Brace Krsmanovica"
        },
        "formattedAddress": "Ulica Brace Krsmanovica, 11000 Beograd"
      },
      "matchQuality": {
        "totalScore": 75.6613757,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 100,
          "city": 100,
          "district": 0,
          "street": 23.80952380952381
        }
      },
      "type": "STREET"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.486280429,
          "y": 44.785179183
        },
        "roadAccessCoordinate": {
          "x": 20.48641965,
          "y": 44.78538892
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11050",
          "city": "Beograd",
          "district": "Vozdovac",
          "street": "Ulica Brace Kovac",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Kovac 78, 11050 Beograd"
      },
      "matchQuality": {
        "totalScore": 74.5185185,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 60,
          "city": 100,
          "district": 0,
          "street": 33.333333333333336,
          "houseNumber": 100
        }
      },
      "type": "EXACT_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.48720936,
          "y": 44.771900163
        },
        "roadAccessCoordinate": {
          "x": 20.487489661,
          "y": 44.771980287
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11010",
          "city": "Beograd",
          "district": "Vozdovac",
          "street": "Ulica Brace Jerkovic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Jerkovic 78, 11010 Beograd"
      },
      "matchQuality": {
        "totalScore": 73.962963,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 60,
          "city": 100,
          "district": 0,
          "street": 27.77777777777778,
          "houseNumber": 100
        }
      },
      "type": "EXACT_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.479187063,
          "y": 44.792896261
        },
        "roadAccessCoordinate": {
          "x": 20.479162226,
          "y": 44.792987866
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11118",
          "city": "Beograd",
          "district": "Vracar",
          "street": "Ulica Brace Radovanovic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Radovanovic 78, 11118 Beograd"
      },
      "matchQuality": {
        "totalScore": 69.7142857,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 100,
          "district": 0,
          "street": 23.80952380952381,
          "houseNumber": 100
        }
      },
      "type": "INTERPOLATED_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.479160368,
          "y": 44.793079351
        },
        "roadAccessCoordinate": {
          "x": 20.479185036,
          "y": 44.792987866
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11118",
          "city": "Beograd",
          "district": "Vracar",
          "street": "Ulica Brace Radovanovic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Radovanovic 78, 11118 Beograd"
      },
      "matchQuality": {
        "totalScore": 69.7142857,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 100,
          "district": 0,
          "street": 23.80952380952381,
          "houseNumber": 100
        }
      },
      "type": "INTERPOLATED_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.233608235,
          "y": 44.724906945
        },
        "roadAccessCoordinate": {
          "x": 20.233606377,
          "y": 44.724994697
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11275",
          "city": "Surcin",
          "district": "Boljevci",
          "street": "Ulica Brace Iker",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Iker 78, 11275 Surcin"
      },
      "matchQuality": {
        "totalScore": 66.2893773,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 53.84615384615385,
          "district": 0,
          "street": 35.714285714285715,
          "houseNumber": 100
        }
      },
      "type": "INTERPOLATED_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.215709665,
          "y": 44.729061145
        },
        "roadAccessCoordinate": {
          "x": 20.21563904,
          "y": 44.728919984
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11275",
          "city": "Surcin",
          "district": "Boljevci",
          "street": "Ulica Brace Vujic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Vujic 78, 11275 Surcin"
      },
      "matchQuality": {
        "totalScore": 66.0512821,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 53.84615384615385,
          "district": 0,
          "street": 33.333333333333336,
          "houseNumber": 100
        }
      },
      "type": "EXACT_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.208700102,
          "y": 44.724208887
        },
        "roadAccessCoordinate": {
          "x": 20.208610555,
          "y": 44.724090522
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11275",
          "city": "Surcin",
          "district": "Boljevci",
          "street": "Ulica Brace Gavrajic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Gavrajic 78, 11275 Surcin"
      },
      "matchQuality": {
        "totalScore": 65.4957265,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 53.84615384615385,
          "district": 0,
          "street": 27.77777777777778,
          "houseNumber": 100
        }
      },
      "type": "EXACT_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.259729318,
          "y": 44.793018321
        },
        "roadAccessCoordinate": {
          "x": 20.259889659,
          "y": 44.792888587
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11271",
          "city": "Surcin",
          "street": "Ulica Brace Novakovic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Novakovic 78, 11271 Surcin"
      },
      "matchQuality": {
        "totalScore": 65.3495277,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 53.84615384615385,
          "street": 26.31578947368421,
          "houseNumber": 100
        }
      },
      "type": "EXACT_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.174369855,
          "y": 44.654899615
        },
        "roadAccessCoordinate": {
          "x": 20.174299231,
          "y": 44.654480035
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11500",
          "city": "Obrenovac",
          "district": "Zvecka",
          "street": "Ulica Brace Lazic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Lazic 78, 11500 Obrenovac"
      },
      "matchQuality": {
        "totalScore": 65.0416667,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 43.75,
          "district": 0,
          "street": 33.333333333333336,
          "houseNumber": 100
        }
      },
      "type": "EXACT_ADDRESS"
    },
    {
      "location": {
        "referenceCoordinate": {
          "x": 20.182529515,
          "y": 44.637470222
        },
        "roadAccessCoordinate": {
          "x": 20.18244926,
          "y": 44.6374588
        },
        "address": {
          "country": "RS",
          "state": "Centralna Srbija",
          "province": "Grad Beograd",
          "postalCode": "11500",
          "city": "Obrenovac",
          "district": "Zvecka",
          "street": "Ulica Brace Joksic",
          "houseNumber": "78"
        },
        "formattedAddress": "Ulica Brace Joksic 78, 11500 Obrenovac"
      },
      "matchQuality": {
        "totalScore": 64.8333333,
        "addressScores": {
          "country": 100,
          "state": 0,
          "province": 0,
          "postalCode": 40,
          "city": 43.75,
          "district": 0,
          "street": 31.25,
          "houseNumber": 100
        }
      },
      "type": "EXACT_ADDRESS"
    }
  ]
}
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:
clvo
Posts: 6
Joined: Thu Jun 02, 2022 7:42 am

Re: xLocate - Ergebnis verbessern

Post by clvo »

Hi Bernd,
sorry - I mixed up the sample... and thanks for the hint with mapLanguage!
Here is the correct request / result for the first example:
Response:

Code: Select all

{
	"address": {
		"country": "RS",
		"state": null,
		"province": null,
		"postalCode": "11000",
		"city": "BEOGRAD",
		"district": null,
		"subdistrict": null,
		"street": "26 DUKATSKA",
		"houseNumber": null
	},
	"searchOptions": {
		"allowedCountries": [
			"RS"
		],
		"outputCountryType": 0,
		"outputCountryTypeSpecified": true
	},
	"requestProfile": {
		"vehicleProfile": null,
		"featureLayerProfile": null,
		"routingProfile": null,
		"renderingProfile": null,
		"clusterPlanningProfile": null,
		"mapLanguage": "und-Latn-t-sr",
		"userLanguage": null
	},
	"geometryOptions": null,
	"timeouts": null,
	"userLogs": null,
	"scope": null,
	"storedProfile": null,
	"coordinateFormat": null
}
Request:
{
"results": [
{
"location": {
"referenceCoordinate": {
"x": 20.690380057,
"y": 44.452610048,
"zSpecified": false
},
"roadAccessCoordinate": {
"x": 20.690580441,
"y": 44.452709187,
"zSpecified": false
},
"address": {
"country": "RS",
"state": "Centralna Srbija",
"province": "Grad Beograd",
"postalCode": "11400",
"city": "Mladenovac",
"district": "",
"subdistrict": "",
"street": "Ulica Dunavska",
"houseNumber": "26"
},
"formattedAddress": "Ulica Dunavska 26, 11400 Mladenovac"
},
"matchQuality": {
"addressScores": {
"country": 100.0,
"countrySpecified": true,
"state": 0.0,
"stateSpecified": true,
"province": 0.0,
"provinceSpecified": true,
"postalCode": 40.0,
"postalCodeSpecified": true,
"city": 41.1764705882353,
"citySpecified": true,
"districtSpecified": false,
"subdistrictSpecified": false,
"street": 46.15384615384615,
"streetSpecified": true,
"houseNumber": 100.0,
"houseNumberSpecified": true
},
"totalScore": 72.316365,
"totalScoreSpecified": true,
"distanceSpecified": false
},
"type": 3,
"typeSpecified": true
}
],
"resultLimitations": null
}

BR Claus
User avatar
Bernd Welter
Site Admin
Posts: 2684
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate - Ergebnis verbessern

Post by Bernd Welter »

Hi Claus,

what version of the geocoding index do you use? I use the same one as XServer Internet (20220307)
When I preform your request on XSI2 the output shows a proper street level hit.

Not the house number itself (26 is missing - for whatever reason), but at least the street is found.

In your case the zip code 11000 seems to be wrong, too (proper value: 11050)

Let's check this in our 1:! session.

Bernd

PS: new index is available on request for on premise users.
Attachments
My hit.
My hit.
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:
User avatar
Bernd Welter
Site Admin
Posts: 2684
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate - Ergebnis verbessern

Post by Bernd Welter »

Just learned another code: "und-Latn-t-uk"... unfortunately the documentation of the codes is quite generic.
Attachments
mapLanguage=&quot;und-Latn-t-uk&quot; returns the transcripted version of the ukrainian texts. Therefore the map looks equal to the texts below
mapLanguage="und-Latn-t-uk" returns the transcripted version of the ukrainian texts. Therefore the map looks equal to the texts below
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:
User avatar
Bernd Welter
Site Admin
Posts: 2684
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xLocate - Ergebnis verbessern

Post by Bernd Welter »

And here comes a GREEK example: Use MapLanguage="und-Latn-t-el" to get " Greek transliterated to latin alphabet (transformation subtag)."
Attachments
greek.png
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:
Andreas Schönebeck
Posts: 15
Joined: Fri Jul 09, 2021 3:11 pm

Re: xLocate - Ergebnis verbessern

Post by Andreas Schönebeck »

What maplanguage parameter can we use to translate all languages to latin, e.g. russian, ukrainian, greek, etc.

E.g. with reverse geocoding we do not know at request time which country prefix (e.g. "-t-el") we need to use. So a "one for all" solution would be great.
Post Reply