xS-XF: Experimental properties on SearchLocationsResult

deals with geocoding and reverse geocoding

xS-XF: Experimental properties on SearchLocationsResult

Postby gottjas » Tue Dec 06, 2016 4:06 pm

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
gottjas
 
Posts: 5
Joined: Tue Dec 06, 2016 3:51 pm

Re: Experimental properties on SearchLocationsResult

Postby Bernd Welter » Tue Dec 06, 2016 4:24 pm

Hello Jason,

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

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

https://www.youtube.com/channel/UCgkUli9yGf0gwTDdxbMZ-Kg
User avatar
Bernd Welter
Site Admin
 
Posts: 870
Joined: Mon Apr 14, 2014 10:28 am

Re: Experimental properties on SearchLocationsResult

Postby gottjas » Tue Dec 06, 2016 4:31 pm

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
Last edited by gottjas on Tue Dec 06, 2016 6:59 pm, edited 1 time in total.
gottjas
 
Posts: 5
Joined: Tue Dec 06, 2016 3:51 pm

Re: Experimental properties on SearchLocationsResult

Postby bocajo » Tue Dec 06, 2016 4:44 pm

Hello Jason,

to access attributes marked as experimental you need to use the experimental API, cf. https://xserver2-europe-eu-test.cloud.ptvgroup.com/dashboard/Default.htm#TechnicalConcepts/DSC_Experimental_Features.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
bocajo
 
Posts: 22
Joined: Tue Mar 01, 2016 3:05 pm

Re: Experimental properties on SearchLocationsResult

Postby gottjas » Tue Dec 06, 2016 7:13 pm

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
gottjas
 
Posts: 5
Joined: Tue Dec 06, 2016 3:51 pm

Re: Experimental properties on SearchLocationsResult

Postby bocajo » Wed Dec 07, 2016 10:06 am

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
Jochen Anderer
Senior Software Engineer
PTV GROUP GERMANY
bocajo
 
Posts: 22
Joined: Tue Mar 01, 2016 3:05 pm

Re: Experimental properties on SearchLocationsResult

Postby gottjas » Thu Dec 08, 2016 6:01 am

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
gottjas
 
Posts: 5
Joined: Tue Dec 06, 2016 3:51 pm

Re: Experimental properties on SearchLocationsResult

Postby bocajo » Thu Dec 08, 2016 8:13 am

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
Jochen Anderer
Senior Software Engineer
PTV GROUP GERMANY
bocajo
 
Posts: 22
Joined: Tue Mar 01, 2016 3:05 pm


Return to PTV xLocateServer