Return names of natural points of interest - google-maps

Using the google maps javascript v3 api, I'm trying to copy the "What's here" functionality currently present on the official google maps website. It works, aside from the but one difference with the official site seems that it won't return lakes or oceans as result.
Is this possible with any of the google apis or do you have to defer to other databases for this? (Which would be a shame!)
An example would be "Lac de Nino" (Corsica, France) , I can search for it & the api returns the correct results, however, providing the geocoder or places api with the lat lng will either return the address or closest natural park, but not the name of the lake.
I know there are other services, such as geonames, but to ease implementation, I was curious if it's possible with any google api currently available.

Related

Geo coding google maps API with udacity

I recently started a google maps API course with Udacity, one of the questions involves geocoding and I have hit a brick wall with it.
the task that I have asked to do is "Using geocode WEB SERVICE request in your browser find the fun place that the following coordinate describes"
the coordinates being LAT:33.1262476 LNG:-117.3115765 the videos on the course didn't go into to much detail.
Any help?
Read about Google's geocoding API, and in particular the reverse lookup of lat/long coordinates -> addresses and/or named locations.
https://developers.google.com/maps/documentation/geocoding/intro#reverse-example
For your case, it will be something like making a request to this URL:
https://maps.googleapis.com/maps/api/geocode/json?key=YOUR_API_KEY&latlng=33.1262476,-117.3115765
Note that YOUR_API_KEY is something you'll have to create by registering a Google developer account (which is free).

Google maps GeoCode API doesn't return any result at all?

This is weird. When I search something like "The New York Palace Hotel,America,New York" in Google maps app's search box I get exactly the hotel on the map.
However When I use the maps API,
A GET at http://maps.googleapis.com/maps/api/geocode/json?address=The%20New%20York%20Palace%20Hotel,America,New%20York&sensor=true
I get ZERO results in the response.
It doesn't even give New York as the option in search results.
I am making an app where I use this API to get the lat-long for user provided address.
Now, I don't know why this Google maps API doesn't work the way the Google maps app works.
BUT I wanted to know, is there a way to search and provide Google maps API these search terms as meaningful words where instead of taking whole string as one parameter it knows which city I am searching and which Address I ams searching.
If not, then only option left with me will be to Once the first results fails I make another query for city name only.
recently, i was given a similar task, and came to know the api works reverse... i.e.. we can get address for lat lon that we provide.. and that too has its own restrictions (i.e.. no.of addresses resolved per request, mostly some 2500 address per day something...)....here you can get some info over that...
You are using the Geocoding API. "The New York Palace Hotel,America,New York" is not an address, it is a "place". The Places API might be a better option.
Example of your query using the (javascript version of) the Places API

How can I get same search result as google map

When I am searching "Rudy barber Shop, New York" string in http://maps.google.com, google map showing 10 results...
But When I am using google map api in my App, It only returning two results
http://maps.googleapis.com/maps/api/geocode/xml?address=Rudy%20barber%20Shop,%20New%20York&sensor=false
Now my question is that how can get the same result.
Thanks
Mandeepd
I don't think you can get exactly the same results as in Google Maps.
Google Maps is a whole application. It uses multiple kinds of search engines behind the scenes and some may not be available as APIs, e.g. transit (public transport) directions.
Your sample request shows that you are using The Google Geocoding API which is meant for converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates. This only works for addresses, not businesses. When you put a business name in front of the address, the Geocoding API still tries to figure out where that may be, based on the part of your query that looks like an address. However, the Geocoding API is not meant for that use.
If you are after searching businesses around a given location, maybe you could use the The Google Places API (Experimental) but make sure to comply with its Requirements.

Google Places API vs AJAX Search API and Local Search Control

I've started developing a small app which main goal is to draw a map using Google Maps API (v3), and to show business in the area drawn (bars, restaurants and so on).
I found the Google Places API that was supposed to be released this month but it hasn't been. As far as I know the point of that API is to offer results from the Google's database of business, so later we could put those business in the map.
However now I've found this sample which is using the AJAX Search API and Local Search Control for Google Maps to do the same thing.
So the question is, what is the point of the new Google Places API?
Thank you in advance!
The Places API returns a list of locations near a specific lat/lng, while the Local Search API allows for an arbitrary search of Google's database of business listings and other POIs.

How to handle inaccurate Google Maps locations?

When I type in addresses in Google maps for locations in Asia, quite a lot of them are off by more than 200 metres. For example, "blk 85 bedok north road, singapore" is off by more than 300 metres. While I don't expect Google Maps to be spot on every time, sometimes the error is too great for certain use cases. What options do I have to handle inaccurate Google Maps locations in a web app? The web app should let the user enter an address or postal code as part of an entry and I will geocode the address and store the lat-long.
You could use bing, yahoo's and google's Geo Location api's to find latitude and longitude for a location, average the results together and use the result. Thus, if they all agree, you still get a good location, but if they disagree you get the best approximation of all three.
You could even programmatically compare the results from each engine and throw out any that don't agree with the others (for instance, if bing and yahoo agree and google does not, you could throw out google).
Beyond that, if you have a collection of addresses you know to be wrong, you could simply store the correct longitude and latitude for those points, and override the results in those cases.
Of course, to get around this problem at all, you'll need to geocode the addresses, check their validity in some way (as described above), and plot them using their latitude and longitude.
You don't have any fixes for this really, you're at the mercy of the accuracy of google maps here. The important part is you don't know if the address in inaccurate when doing one search to the next, so nothing you can do to handle it.
You can post a topic here and google will see it and often respond as well: Google Maps Local Listing Forums. I'd open something there with some of your examples and hope they get more accurate...that's all you can do in this case.
There are always other alternatives as well, yahoo and bing have mapping APIs, but I have no idea how much better or worse off you'd be going that route.
The problem is not the lat/lng data, in fact, they are correct. The problem is that the geo coords of the map tiles of the public Google maps api are inaccurate. The maps at maps.google.com are provided by a different map provider than the map tiles used with the public Google Maps API that you can embed in your website, use in your own applications, etc.
Check my recent posting at Google Maps & apps with mapview have different current positions
Is the result out on maps.google.com as well as through the maps api?
If on google maps live site the result is accurate then you can do an ajax search to return the correct lon/lat.
I have used this when geocoding UK postcodes
Geocoding UK Postcodes with Google Map API
I tried to reply to the upper answer, but I am not qualified enough yet. Just be aware that whatever you're using for geocoding, sometimes has restrictions on the use of that data. For example, google's geocoding API isn't allowed to be used to display information retrieved anywhere but google maps. The same might be for the others, I don't know what your project is, but it's something to be aware of.