No results with incorrect state

deals with geocoding and reverse geocoding
Post Reply
Benjaminabat
Posts: 5
Joined: Wed Dec 16, 2015 12:45 pm

No results with incorrect state

Post by Benjaminabat »

When calling findAddress[es] with an incorrect state name no result is returned.
For example if I have the address:

Code: Select all

"addr": {
    "country": "D",
    "postCode": "",
    "city": "Münster",
    "city2": "",
    "state" : "Nrth Rhine-Westfalia",
    "street": "",
    "houseNumber": ""
  },
I get no result. However if the state is omitted several results are shown.
Why is the state not discarded by the xLocate Server if it can not be found?
User avatar
bocajo
Posts: 44
Joined: Tue Mar 01, 2016 3:05 pm

Re: No results with incorrect state

Post by bocajo »

There is a paramater called Region.CheckState it is set true per defaul because for some countries the state information. But there is no fuzzy or phonetic search for a state input.
There are two ways to swich off the parameter Region.CheckState.

1. In the config file (.\xlocate-x64-1.22.0.1\conf\native-default.xml)
- shut down the xLocate
- copy the native-default.xml and set the paramater <Region.CheckState Value="0" Type="bool"/>
- choose a new config nama e.g. native-xyz.xml
- start the xLocate
- send the following request:

Code: Select all

{
  "addr": {
    "country": "D",
    "state": "Nrdrhein-Westfalen",
    "postCode": "",
    "city": "Münster",
    "city2": "",
    "street": "",
    "houseNumber": ""
  },
  "options": [],
  "sorting": [],
  "additionalFields": [],
  "callerContext": {
    "properties": [
      {
        "key": "CoordFormat",
        "value": "PTV_MERCATOR"
      },
      {
        "key": "Profile",
        "value": "xyz"
      }
    ]
  }
}
2. By request:

Code: Select all

{
  "addr": {
    "country": "D",
    "state": "Nrdrhein-Westfalen",
    "postCode": "",
    "city": "Münster",
    "city2": "",
    "street": "",
    "houseNumber": ""
  },
  "options": [{
    "$type": "NamedSearchOption",
    "param": "Region.CheckState",
    "value": "0"
  }],
  "sorting": [],
  "additionalFields": [],
  "callerContext": {
    "properties": [
      {
        "key": "CoordFormat",
        "value": "PTV_MERCATOR"
      },
      {
        "key": "Profile",
        "value": "default"
      }
    ]
  }
}
Edit by Joost: added code tags for readability
Jochen Anderer
Manager Engineer
PTV GROUP GERMANY
Benjaminabat
Posts: 5
Joined: Wed Dec 16, 2015 12:45 pm

Re: No results with incorrect state

Post by Benjaminabat »

Thank you for your reply! This doesn't help me with my usecase though. Maybe I have to elaborate...

I am trying to verify a list of addresses out of a SAP system. The state in these addresses is represented by a number corresponding to a check table. This check table is language dependant and contains the names of the regions for the specified number. Some of the names in that table are false, because the name field is only 20 characters long or because of other mistakes (Westfalia/Westphalia).
Now I would like to send as much information as possible to the xLocate server. So in my case the best scenario would be, that if I send an incorrect state it is ignored. Making my own table with the correct state names seems a bit overkill to me.

If there would be an option to ignore the state conditionally that would be great!
User avatar
bocajo
Posts: 44
Joined: Tue Mar 01, 2016 3:05 pm

Re: No results with incorrect state

Post by bocajo »

So far I know there is no option on server side to ignore the state conditionally. So I guess you have to solve it on client side.

Definitely I recomment to clean up your table and try to match it with the PTV state names.
Jochen Anderer
Manager Engineer
PTV GROUP GERMANY
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: No results with incorrect state

Post by Bernd Welter »

Hello together,

I forwarded the approach of a server side switch to product management.
But: as this has not been demanded by many customers so far the priority
is not at the highest level. Just to be transparent.

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:
Post Reply