How to convert location name to location coordinates - google-maps-api-3

Is it possible to get latitude and longitude from location name using Google Maps API ?
If so how ?

Yes it is very well possible .
make a get request to following URL and in response you will get the info you needed
http://maps.google.com/maps/geo?q=Rajkot,Gujarat,India&output=xml&oe=utf8&key=abcdefg
replace Rajkot,Gujarat,India with the place name you want to query
Document

I assume that you mean 'address' when you say 'name'. Check google maps api

Use GeoCoder to convert name to latitude and longitude....Searchc GeoCoder now

Related

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.

Get post code from getlinkinfo

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

google maps - wrong (different) routes directions

I try to get the instructions of a route direction from two points, but the route appears different when I give the coordinates through the source code (coorect route), than when the function gets them from the textbox. I want you to know that I am interested in finding the route only by the coordinates and not by the address
Thank you in advance
form source code (correct route) - http://www.touchsmart.gr/stackoverflow_map/route_from_variable.html
from textbox (wrong route) - http://www.touchsmart.gr/stackoverflow_map/route_from_text.html
Those are two different things. The correct route is passing in google.map.LatLng objects, the incorrect route is not. To use geographic coordinates you need to pass in google.map.LatLng objects, otherwise the coordinates get geocoded.
destination LatLng|string Location of destination. This can be specified as either a string to be geocoded or a LatLng. Required.
origin LatLng|string Location of origin. This can be specified as either a string to be geocoded or a LatLng. Required.
See this question for how to convert a comma separated string to a google.maps.LatLng object.

Documentation for Google maps MarkerImage url string in constructor

The first argument of the google.maps.MarkerImage class constructor is a url string with several GET variables.
This is an example of the url string in use. The color variable is clear, but what do the other variables do?
Yes, what Trott says. Basically the markerimage URL is a relative or absolute url to an image, nothing more or less. So depending on where you get your images from, it might have a querystring on it (e.g. if the marker is to be dynamically generated by a server-side script). So in this case you just happen to be using the Charts API to get a dynamic image for your marker.
The first argument is not necessarily a URL string with several GET parameters. It is simply a URL string. Google Maps API uses that URL to retrieve the image. If there are GET parameters, they are used (or ignored) by the server from which the image is being retrieved.
The example you link to contains a URL using Google's Charts API. The definitions for the parameters are at http://code.google.com/apis/chart/image/docs/chart_params.html.

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