Limit Search to an exact PostalCode

deals with geocoding and reverse geocoding

Limit Search to an exact PostalCode

Postby MichaelSchwabl » Tue Oct 16, 2018 4:11 pm

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
Posts: 13
Joined: Tue Apr 10, 2018 10:56 am

Re: Limit Search to an exact PostalCode

Postby Bernd Welter » Wed Oct 17, 2018 7:14 am

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:
xml code
<SearchOptionBase xsi:type="NamedSearchOption"
value="1" param="Town.Active" xmlns="" />

javascript code
"options": [
"$type": "NamedSearchOption",
"value": "1",
"param": "Town.Active"

Best regards,
Bernd Welter
Manager Technical Consulting & Requirement Engineering
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
Posts: 1295
Joined: Mon Apr 14, 2014 10:28 am

Re: Limit Search to an exact PostalCode

Postby bocajo » Wed Oct 17, 2018 12:29 pm

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
Senior Software Engineer
Posts: 30
Joined: Tue Mar 01, 2016 3:05 pm

Return to PTV xLocateServer