Is there any such API where given a location (in terms of latlong), I could find whether the given point is on road/street or not. And if possible also gives me nearest street/road to that location. I found API from [Find nearby Streets] -> http://www.geonames.org/maps/us-reverse-geocoder.html#findNearbyStreets , but it just gives solution for US.
Help me if u know of any better solution/algorithm. ( I am particularly interested in India.)
You can use the Google Maps Geocoding API which does exactly that: https://developers.google.com/maps/documentation/geocoding/intro
Take a look at the "Reverse Geocoding" section.
Google maps api provides reverse Geocoding api, you need to pass lat and long values to get address
http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false
Check this
http://code.google.com/apis/maps/documentation/geocoding/#JSON
Much simpler with OSRM (nearest) webservice. Look at my answer here:
https://stackoverflow.com/a/30403046/4640499
Related
For a mobile application, I would like to get all places included in a map screen view (hence the rectangular zone).
Reading the API's documentation, I found out that Find Place requests can use a rectangular location bias, but only answer with one place; on the other hand, Text Search requests return several places, but do not have rectangular location bias; moreover, both need some input text, which I don't want to provide.
Which request type is the best to match my problem? (maybe Places API offers a suitable request I don't know about)
Hey you could define a zone using latlong then use the Nearby Search Requests
and it should give you all places in that zone
I'm developing a web app wherein I need to get the "exact" address given a latitude and longitude pair. I tried Maps Geocode API as well but it doesn't give the exact address. I think Places API would be a good option alas I don't get how to use it.
I'm using golang.
IMO, if you think that reverse geocoding results a bad, Places API results wouldn't make you happier.
Here is the sample of Places API
https://maps.googleapis.com/maps/api/place/search/xml?location=55.753720,37.620144&key=google_map_api_key
And Geocoder to compare
https://maps.googleapis.com/maps/api/geocode/xml?latlng=55.753720,37.620144
As you can see, there is no address in Places API results. The first addresses you may get only after addition radius parameter:
https://maps.googleapis.com/maps/api/place/search/xml?location=55.753720,37.620144&radius=100&key=google_map_api_key
For me, trying to decide which address within 100 meters is right is more complex task than simple use of the best possible result from geocoding.
Kind of what it says on the tin: is there an API method, anywhere in the Google Maps/Directions/Geocoding APIs, that gives the bearing of a street relative to north when given a PlaceID? I've already tried maps/api/place/details, but it doesn't seem to contain the information I want.
I hope this will help you.
Try this:
https://maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal+Studios+Hollywood4&
I was wondering if it is possible to find a specific place using the google places api.
I know the name of the place, the address or website url, and the coordinates.
I need this to get the ratings this place has.
Is this possible? If not, is it going to be?
I think your best bet would be to do a nearbysearch with the location (lat,long), a small radius, and the name and types parameters to narrow it down. If you are targeting a specific place, then you can just manually find it in the results and use its reference for a Details request in your solution.
If the target place can be dynamic, for example based on user input, then you might want to show the user the list of results and let them choose the correct one. I don't think there's a way to guarantee that you will always get exactly the result you're looking for as, say, the first result in the list. Experiment with different types of requests and parameters and try to get a sense for the behaviour of the responses to find what will work best for your solution.
I want to sort results fetched via google places api based on increasing distance from "location" (a pair of lat, lng). There is no documentation on their official page. http://code.google.com/apis/maps/documentation/places/#PlaceSearchRequests
It just says:
Each element of the results array contains a single result from the
specified area (location and radius), ordered by prominence. The
ordering of results can be influenced by check-in activity within your
application - Places with many recent check-ins may figure more
prominently in your application's results. The result may also contain
attribution information which must be displayed to the user.
However they didnt mention anything about their prominence meter algorithm.
The Google Places API does not currently support this feature.
There is a feature request for this in the Places API issue tracker here:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=3322
Please click the 'star' icon to be notified of future changes, and to let us know you are interested in seeing it resolved.
Cheers
Chris
This has been added to the API, please use the 'rankby=distance' instead of 'radius' in your Place Search Request as described in the documentation here: https://developers.google.com/maps/documentation/places/#PlaceSearchRequests