Get post code from getlinkinfo - here-api

Is there a way to get the post code as part of the address returned by the getlinkinfo resource of the routing API? Example:- http://route.st.nlp.nokia.com/routing/6.2/getlinkinfo.xml?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&waypoint=50.05564304861044,8.38889128575724&linkattributes=all returns street, city, country but not postcode

You can use the HERE Geocoder API and do a reverse geocode for the position. This will get you the postal code among other location information and link attributes (locationattributes=linkInfo). The last option is new since this week. Let me know if this helps or what exactly you are trying to do and what response details you need.
Following is an example call:
http://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.xml?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&gen=8&maxresults=1&mode=retrieveAddresses&prox=50.05564304861044%2C8.38889128575724%2C250&locationattributes=linkInfo

Related

How to get a startpoint, endpoint and distance of "boatFerry" segment in Here Routing API

I'm trying to get "boatFerry" segment (startpoint, endpoint, distance, etc.) from the calculated route response via Here Routing API. What parameters I should use in my request to get it?
There is no straight attribute or field to get only the boatFerry segment details in a route. However, you can get this by using the below query where link information is provided.Every link has flags. You can search for the flag of your interest (in the below example search for railFerry) and sum their lengths.This will give you the ferry length in your route distance.Also, it provides you the start and end points.
https://route.cit.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!stopOver!51.006511,2.321095&waypoint1=geo!stopOver!51.137062,0.911495&mode=fastest%3Bcar%3Btraffic%3Aenabled&app_id=xxx&app_code=yyy&representation=linkPaging&language=de-de&returnElevation=true&maneuverAttributes=position%2Clength%2CtravelTime%2CstartAngle&instructionFormat=text&routeAttributes=waypoints%2Csummary

How and what do responseattributes return for the Here Batch Geocoder API?

The Here Batch Geocoder API indicates that the responseattributes request parameter can be used. I'm interested in getting geocode quality results back from a batch geocode file.
In the Response Attribute switches documentation it indicates that the default options would be On by default: matchQuality, matchType. But I'm not clear on how this actually gets returned from the batch geocoding API. It sounds like these attributes would be returned in the response, and in the API Explorer for the standard geocoder API it does appear that these are returned in the JSON response.
But the Batch Geocoder API returns an XML response, and then ultimately a collection of files including a final data file. In the Batch Geocoder API explorer, the sample XML response does not include either of those default fields.
At one point the batch geocoder demo credentials listed on the Here documentation worked, and I was able to pull back a small sample results file. I did not see those default responseattributes columns on any of the downloaded files, either.
For the Batch Geocoder API, is there a way to get back information about the quality of the geocoded address, matchQuality, matchType, etc?
The responseattributes parameter enables the additional response attributes to be includable with results, e.g. set it to: responseattributes=all
The outcols parameter attributes then define which ones you get and where.
I use the following request a lot to include scores for results analysis:
http://batch.geocoder.cit.api.here.com/6.2/jobs?action=run&app_code=[your-app-code]&app_id=[your-app-id]&gen=8&header=true&indelim=|&outdelim=|&outcols=displayLatitude,displayLongitude,navigationLatitude,navigationLongitude,mapViewTopLeftLatitude,mapViewTopLeftLongitude,mapViewBottomRightLatitude,mapViewBottomRightLongitude,locationLabel,houseNumber,street,district,city,county,state,postalCode,country,relevance,matchLevel,matchType,matchCode,mapReferenceId,responseAdditionalData,addressAdditionalData&addressattributes=all&locationattributes=all&responseattributes=all&maxresults=5&outputcombined=true&mailto=[yourname#domain.com]
It turns out that when you define the output columns for a batch geocode request, you can also list "Address Match Information" fields which provide the information I'm looking for: https://developer.here.com/rest-apis/documentation/batch-geocoder/topics/data-output.html
These fields are entered in the requset query parameters and then showed up on the resulting output data file that was downloaded.
I'm still not sure what the responseattributes parameter does then on the batch geocoder, or if it's even relevant.

How can I get the id of some Weibo post

I need to know the ID of the posts in Weibo, because I want to do a call to the API and the weibo ID is required, so I don't know how to obtain this ID from an URL.
this is an example for a URL:
http://www.weibo.com/1833141401/AC1klvp6U?mod=weibotime
I thought that 1833141401 was the ID but the API response that the weibo doesn´t exist.
Has anyone worked with this API?
For the url http://www.weibo.com/1833141401/AC1klvp6U :
1833141401 is the user id (uid).
AC1klvp6U is the microblogging id (mid) as weibo calls it.
that mid is base62 encoded.
You could call the weibo API to get the id.
The endpoint you want is /statuses/queryid/en
Example call:
https://api.weibo.com/2/statuses/queryid.json?mid=AC1klvp6U&type=1&isBase62=1
Or you can add your own function to convert that mid to the id like in this post: http://tech.kawo.com/post/74682997654/using-base62-to-generate-a-sina-weibo-post
Weibo uses 2 formats for the same id. You can base64 encode that ID to get the id in the same format that the API accepts.
More info and code samples to perform the operation here: http://blog.sina.com.cn/s/blog_4a238ec201012pnb.html

Google Maps geocode api inconsistencies

I'm trying to geocode this address "188th street & third avenue, bronx NY"
If you run this geocode query through the maps api v3 geocoder, you get back 10 or so results, none of which are in new york.
http://maps.google.com/maps/api/geocode/xml?sensor=false&address=188th%20street%20&%20third%20avenue,%20bronx%20NY
If you paste that same address into google maps, it takes you directly to the intersection in the bronx.
Is there a reason these results are inconsistent, and is there a way I can get the geocoder to give me the correct result, or at least something in the same state?
(at first i thought it was because 'third' was spelled out, so i replaced it with '3rd'. I still got 10 results with one in NYC. however, it was in queens instead of the bronx.)
The problem is that you do not URL-encode & in the address and use it as it is. But this & is used for separation of URL arguments as e.g. between sensor=false&address=. So, the data beyond & is not considered to be part of the address. You need to replace & in the address argument by its URL-encoding %26:
http://maps.google.com/maps/api/geocode/xml?sensor=false&address=188th%20street%20%26%20third%20avenue,%20bronx%20NY
and you will get the one correct location in New York, Bronx:
<location>
<lat>40.8588700</lat>
<lng>-73.8911250</lng>
</location>
Just for information: the Google geocoding web service uses + for spaces in the address. Also, the recommended service URL is http://maps.googleapis.com/maps/api/geocode/. So, you could issue as well the query:
http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=188+street,%26+third+avenue,+bronx+NY
which appears a bit simpler.

QUrl Class's *addQueryItem* method

I want to query the Google map for all the roads leading to a given GPS coordinate.
For that I'll have to place a "query" which can be done by: http://doc.qt.io/qt-4.8/qurl.html#addQueryItem
Now I want to know how to figure out that what should be the key and its corresponding value here?
Should the key be "road"/"roads"? Whats the way to decide that? And I want all the roads not a particular one!
Any hints?
An HTTP URL has the following format:
http://some/address?key=value&more=values
The part behind the '?' is your query. You have to determine how the resulting URL should look like and add key/value pairs accordingly.
It isn't completely clear to me what you want to accomplish. You might want to check out these Google Maps API Links:
http://code.google.com/intl/de/apis/maps/documentation/staticmaps/#Addresses
http://code.google.com/intl/de/apis/maps/index.html

Resources