Page 1 of 1

xS-XF: Experimental properties on SearchLocationsResult

Posted: Tue Dec 06, 2016 4:06 pm
by gottjas
Hello,

This question refers to the experimental properties in the response of a SearchLocationsRequest (calling the REST endpoint /locations). In the documentation for the Address class (LocationsResponse.SearchLocationsResult[].Location.Address), there are experimental properties for countryName, state, formattedAddress, and attributes[]. I'm never seeing any values in these fields in my responses. Is there a way in the request to indicate that I'd like to get these experimental fields back in the response?

My request is:
GET https://xserver2-europe-eu-test.cloud.p ... nburg%20AT HTTP/1.1

Thank you!
Jason

Re: Experimental properties on SearchLocationsResult

Posted: Tue Dec 06, 2016 4:24 pm
by Bernd Welter
Hello Jason,

please provide the whole request/response. I'd like to forward it to the developers for a proper analysis.

Best regards
Bernd

Re: Experimental properties on SearchLocationsResult

Posted: Tue Dec 06, 2016 4:31 pm
by gottjas
Hi Bernd,

No problem:

GET https://xserver2-europe-eu-test.cloud.p ... nburg%20AT HTTP/1.1
xtok: <my token>
Host: xserver2-europe-eu-test.cloud.ptvgroup.com
Connection: Keep-Alive



HTTP/1.1 200 OK
Cache-Control: private
Vary: Origin
Server: Microsoft-IIS/8.5
xserver-request-id: e26f10e8-0c9a-4645-b64e-ecd662197220
Server: Apache-Coyote/1.1
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 06 Dec 2016 16:03:57 GMT
Content-Length: 263
Content-Type: application/json
Connection: keep-alive

{"$type":"LocationsResponse","results":[{"location":{"referenceCoordinate":{"x":15.544469844,"y":48.110919932},"roadAccessCoordinate":{"x":15.545089751,"y":48.110801705},"address":{"city":"Weinburg","postalCode":"3205","street":"Mühlhofen","houseNumber":"4"}}}]}


In the address object, none of the experimental properties are populated (countryName, state, formattedAddress, attributes[])

Thanks,
Jason

Re: Experimental properties on SearchLocationsResult

Posted: Tue Dec 06, 2016 4:44 pm
by bocajo
Hello Jason,

to access attributes marked as experimental you need to use the experimental API, cf. https://xserver2-europe-eu-test.cloud.p ... atures.htm.

For the case at hand, changing the request to
https://xserver2-europe-eu-test.cloud.ptvgroup.com/services/rest/XLocate/experimental/locations/M%C3%BChlhofen%204%20Weinburg%20AT
should do the job.

Best regards,
Jochen

Re: Experimental properties on SearchLocationsResult

Posted: Tue Dec 06, 2016 7:13 pm
by gottjas
Hi Jochen,

That works perfectly, thank you! Is there any documentation about what the different admin and locality levels mean? For example, I'm seeing ADMIN_14, ADMIN_11, ADMIN_5, LOCALITY_0, LOCALITY_1, and I don't know what they represent.

Thank you,
Jason

Re: Experimental properties on SearchLocationsResult

Posted: Wed Dec 07, 2016 10:06 am
by bocajo
Hi Jason

We descriped the meaning of a Location and the address result fields in our API documantation:
https://xserver2-europe-eu-test.cloud.p ... e.Location
The addressing schemes vary between countries and the locality schemes vary strongly within a country and depends on the data provider.
For a Here map I can say, ADMIN_5 is called in Germany e.g. "Landkreis" and in France "Comté" for other countries (Irland or Netherland) it isn't filled. ADMIN_11 is called in Germany e.g. "Gemeinde", in France "Municipalité" this is set for every country and corresponds to the city field.
The Locality fields are representing the city and all distiricts which belongs to an address. But at the moment the order can change from city to city. But normaly the LOCALTY_0 should corresponds to the city field.

Best regards
Jochen

Edit by JCL: fixed link

Re: Experimental properties on SearchLocationsResult

Posted: Thu Dec 08, 2016 6:01 am
by gottjas
Thanks again Jochen,

I have one more question. For my input addresses, I have AddressLine, City, PostalCode, Country available. If I'm using the REST endpoint with /locations, how do you recommend I format the query string in order to get the best results? <Address> <City> <Country> is what I'm using, and it seems to be working fairly well. Should I add the postal code somewhere in there? Should I add any commas or other formatting in there?

Thanks,
Jason

Re: Experimental properties on SearchLocationsResult

Posted: Thu Dec 08, 2016 8:13 am
by bocajo
Hi Jason

Good to hear that the xLocate is working "fairly well", thanks :)
I recommand to use the postal code, this can help to find the correct address especially if the street name exists multiple times within a city. No special format is needed for the input string. You can set the postal code wherever you want and should always get the same result.

Best regards
Jochen