more and more partners ask me for assistance when it comes to the current challenge of
Code: Select all
I am supposed to replace xServer1 Geocoding with newer PTV APIs (PTV Developer based or in nsome rare cases xLocate 2)- how can I approach this?
- xLocate1 offers a large set of parameters you can use to control filters and structure of a result:
The good news are, the newer APIs are less complicated when it comes to such parameters. That's because we reduced the set to a bare minimum. Might be subject to change but for now you could more or less just filter
Code: Select all
<SearchOptionBase xsi:type="SearchOption" value="1" param="COUNTRY_CODETYPE" xmlns=http://xlocate.xserver.ptvag.com/> … <SearchOptionBase xsi:type="SearchOption" value="999" param="MAX_RESULT" xmlns=http://xlocate.xserver.ptvag.com/>
- per allowed countries (which has been invented also on behalf of performance)
- how to return the country value of a result address (not really a structural parameter if you ask me, as it does not influence "which" addresses are returned)
- Furthermore there have been much more quality properties in the output such as
You may have used this info to apply sorting and filtering on client side. As of early 2024 the response of the newer APIs is not as detailed as you are used to.
Code: Select all
<ResultField xmlns=http://xlocate.xserver.ptvag.com>POPULATION</ResultField> … <ResultField xmlns=http://xlocate.xserver.ptvag.com>CLASSIFICATION_DESCRIPTION</ResultField>
- Just to be complete: also the new APIs results are based on
- complete strings in the addresses wherever possible (no oinput street? you wont't get a street name in the response (besides reverse geocoding)
- score : designed to mainly sort results (better score...) and to filter (score too low? Kick it!)
- coordinates (even with the new rooftop coordinates!)
- various further quality properties : often used for client side sort / filter
- Now some of you have built a complex business logic based on iteration:
- Perform initial geocoding
- If insufficient due to quality criteria, score... iterate...
- change search options
- change input fields (e.g. remove city name or street)
Bernd