Limit Search to an exact PostalCode

deals with geocoding and reverse geocoding
Post Reply
MichaelSchwabl
Posts: 14
Joined: Tue Apr 10, 2018 10:56 am

Limit Search to an exact PostalCode

Post by MichaelSchwabl »

Hi!
Is it possible to limit the search to an exact postalcode?
We have an issue, that if the street is not found, the search also delivers results in other postal areas.

From other posts in this forum we found, that we can analyse the matching result with e.g. POSTCODE_CLASSIFICATION
But the question is, if it is possible to tell the geocoder to search just in the provided postal area?

We use findAddress() on X-Server Internet to search for Bria-Weg , AT-2162 Falkenstein, which delivers weired results depending on if city = "Falkenstein" or city = "Falkenstein bei Poysdorf"

We tried different SearchParameters which did not change anything.
By the way: How can we specify the Option Town.Active on X-Server Internet?

thx, Michael
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Limit Search to an exact PostalCode

Post by Bernd Welter »

Hello Michael,

in xLocate 1 the engine returns sometimes more results than expected. Last but not least this is the reason why we also provide a large number of extended attributes per address: this enables clients to sort and filter hits in they desired way.
So removing each entry which doesn't match your requirements (e.g. because the postcode doesn'T match by 100%) isn'T a big thing.

I'll forward your request to DEV anyway and ask them for some feedback.

About the specific option you mentioned: use the NamedSearchOption class:

Code: Select all

<ArrayOfSearchOptionBase_2>
	<SearchOptionBase xsi:type="NamedSearchOption" 
value="1" param="Town.Active" xmlns="http://xlocate.xserver.ptvag.com" />
</ArrayOfSearchOptionBase_2>

Code: Select all

"options": [
    {
      "$type": "NamedSearchOption",
      "value": "1",
      "param": "Town.Active"
    }
  ]
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:
User avatar
bocajo
Posts: 44
Joined: Tue Mar 01, 2016 3:05 pm

Re: Limit Search to an exact PostalCode

Post by bocajo »

Hi Michal

If you try the following request you should also get the city 2162 Falkenstein as result address:

{
"addr": {
"country": "A",
"postCode": "2162",
"city": "Falkenstein bei Poysdorf",
"city2": "",
"street": "Bria-Weg",
"houseNumber": ""
},
"options": [{
"$type": "NamedSearchOption",
"value": "0",
"param": "PreferStreetOnCityStreetConflicts"
}],
"sorting": [],
"additionalFields": [],
"callerContext": {
"properties": [
{
"key": "CoordFormat",
"value": "PTV_MERCATOR"
},
{
"key": "Profile",
"value": "default"
}
]
}
}

Best regards, Jochen
Jochen Anderer
Manager Engineer
PTV GROUP GERMANY
Post Reply