xS-XF: Experimental properties on SearchLocationsResult

deals with geocoding and reverse geocoding in the context of PTV Geocoding&Places, PTV Geocoding&Places OSM and PTV xLocate 1 and 2
Post Reply
gottjas
Posts: 5
Joined: Tue Dec 06, 2016 3:51 pm

xS-XF: Experimental properties on SearchLocationsResult

Post 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
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Experimental properties on SearchLocationsResult

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

Re: Experimental properties on SearchLocationsResult

Post 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
Last edited by gottjas on Tue Dec 06, 2016 6:59 pm, edited 1 time in total.
User avatar
bocajo
Posts: 45
Joined: Tue Mar 01, 2016 3:05 pm

Re: Experimental properties on SearchLocationsResult

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

Re: Experimental properties on SearchLocationsResult

Post 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
User avatar
bocajo
Posts: 45
Joined: Tue Mar 01, 2016 3:05 pm

Re: Experimental properties on SearchLocationsResult

Post 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
Jochen Anderer
Manager Engineer
PTV GROUP GERMANY
gottjas
Posts: 5
Joined: Tue Dec 06, 2016 3:51 pm

Re: Experimental properties on SearchLocationsResult

Post 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
User avatar
bocajo
Posts: 45
Joined: Tue Mar 01, 2016 3:05 pm

Re: Experimental properties on SearchLocationsResult

Post 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
Jochen Anderer
Manager Engineer
PTV GROUP GERMANY
Post Reply