use google map places api with direction service - google-places-api

i want to mark polylines on road using the direction service , however when i use a place name in the origin paramter it returns something else
for e.g
http://maps.googleapis.com/maps/api/directions/xml?origin=candies bandra west&destination=thadomal shahani engineering college&sensor=false
this is my request , but what i get in response to the origin is just : Bandra West, Mumbai,
Maharashtra, India
i have tried other queries too, like 'carter road amphitheater bandra' but even here the response is returned as bandra west , mumbai , maharashtra , india

Related

How to get geolocation from Eircode/Post Code accurately

I am trying to get latitude and longitude from Ireland Eircode by using google API but I am not getting data from some postcodes given below:
A96X7F2
E45XD68
When I am trying to get data from this, It's returning status ZERO_RESULTS
https://maps.googleapis.com/maps/api/geocode/json?address=A96X7F2&key=API_KEY
Note: In most cases, I am getting data by using this API.
Try specifying the region:
https://maps.googleapis.com/maps/api/geocode/json?address=A96X7F2&region=ie&key=API_KEY
Issues with postcodes are discussed on their issue tracker here:
https://issuetracker.google.com/issues/73030863?pli=1
They say in that link that for best results use region or component filtering. [Both are ways to specify region, but the former is a hint, the latter is a filter.]

Google Places API for Hospitals

I am using Google Places API to search nearby hospitals from a location. My problem is that I want to get famous and big hospitals but the problem is the API is fetching clinics and even dental clinics too. How I can be more specific?
Query URL : https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=24.9044526,67.077706&type=hospital&radius=500&key=[API_KEY]
Although they are not famous even the medical facilities provided there are not sufficient for emergency case.
I have also tried increasing the radius but got same response.
I know this post is a bit old but this worked for me:
var request = {
location: location,
rankBy: google.maps.places.RankBy.DISTANCE,
type: "hospital",
keyword: "(emergency) AND ((medical centre) OR hospital) AND (24 hours)",
};
service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);

Alexa rank graph by country

As we know , Alexa shows graph for global progress of a website for example
http://www.alexa.com/siteinfo/netshahr.com
shows the graph for world but not the country based .This would be useful for who target specific country and not the world. Please introduce a way to show graph based on country value .
Found or better to say created because there is not same tool on the internet.
https://alexa.netshahr.com/dailyrank
You can track specific domain based on country . For example here is a sample for own domain
netshahr.com alexa dailyrank

Identify the type of place when getting results from Google Places API

I have implemented Google places search.
The problem is that i want to identify that the list of locations returned by the API do contain any airport in it.
As per documentation Google Place do support only these types to identify the place type
administrative_area_level_1
administrative_area_level_2
administrative_area_level_3
administrative_area_level_4
administrative_area_level_5
colloquial_area country establishment
finance
floor
food
general_contractor
geocode
health
intersection
locality
natural_feature
neighborhood
place_of_worship
political
point_of_interest
post_box
postal_code
postal_code_prefix
postal_code_suffix
postal_town
premise
room
route street_address
street_number
sublocality
sublocality_level_4
sublocality_level_5
sublocality_level_3
sublocality_level_2
sublocality_level_1
subpremise
There is no airport in the list.
Any idea how can i do it ?
Your list might be incomplete.
According to https://developers.google.com/places/supported_types there's "airport" in it as well.
Example:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=59.4141,24.8334&radius=50&key=[YOUR_API_KEY]

Google places api restaurant types

When you search for a restaurant in Google places and go to the business profile (i.e.:
https://plus.google.com/107507038669791289691/about?hl=en) the restaurant has a tag (in this case Mexican Restaurant). But when using the Google places api all I can see is a types list
"types" : [ "restaurant", "food", "establishment" ]
Anyone know if it's possible to get the tag "Mexican Restaurant" somehow?
I know about the supported types (https://developers.google.com/places/documentation/supported_types). It is not super helpful.
I was also working in a project which need to get more details about a place using Google Maps and Google Places APIs, and I really spent many hours trying to find something that can help ( Google Places API, Google Maps API, google+ APIs, ... ) but nothing ... the only things that I found is theses 2 issues ( feature requests ) which I hope that Google will add to their APIs someday :
Issue N° 5260 with 13 stars.
Issue N°7878 with 4 stars.
I hope with this SO question that we get more interested persons to get the feature in a soon future version of Google Map or Google Places APIs.
For the Google Places for Work API, I didn't find any information to confirm or not that it contains such feature, but I don't think so.
Hope that can help.
I think you would probably have to revert to the text search method on the api..
https://developers.google.com/places/documentation/search#TextSearchRequests
So your request would end up looking something like the below, restricted down to a specific area
https://maps.googleapis.com/maps/api/place/textsearch/json?query=Mexican+Restaurant&sensor=true&location=40.846,-73.938&radius=20&key=yourKeyHere
However this will return all other Mexican restaurants in the area, so if you just want to return the one result I would use the Place Details request instead.
Separate your place types by PIPE symbol "|"
try like this :
String types = "cafe|restaurant|museum" // Listing places only cafes, restaurants and museums.

Resources