Google geocode location result differs from maps result - javascript

I have a address in Germany
Deutschland, 13086 Berlin, Caligariplatz 1
If I search for "Caligariplatz 1" directly in maps it shows the right location.
[https://www.google.de/maps/place/Brotfabrik/#52.552605,13.430414,17z][1]
If I use the geocode function from the api
[https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=13086%20Berlin,%20Caligariplatz%201][2]
The formatted address in the result is 13086 Berlin, Deutschland without the street. The location is wrong. The location_type is only APPROXIMATE
Is it possible that some streets are not known by the geocode Database?
It's not the only problem. How can i fix it?

A couple of things first:
The geocoder is not a general purpose map/location search. It specifically tries to determine a position for an address. It is therefore inherently different to a search on Google Maps, which for example also supports searches like "parks in Berlin". Also, the data used by the Geocoder might be different.
Addresses should be formatted according to the conventions of the local postal service. Your address should be formatted "Caligariplatz 1, 13086 Berlin"
Now for your particular address, Google Maps finds it because there is a Place with that address. You could actually find this location with the Places API.
The address itself does not appear to be in the database, as you can for example confirm with MapMaker. Since this is a square and not a traditional street, the building in question should probably be edited to include the address.

Related

Google Maps API House Number not Showing

I am trying to use Google maps autocomplete input to search for places and fill out the form fields. I do not get the house number (Street Address in the following form) from the API for the following address;
30 Ellabay Crescent, Redland Bay QLD, Australia.
If you try 30 Ellabella Court, South Morang VIC, Australia it fills out the Street Address field properly;
Here my working example in JSFiddle;
https://jsfiddle.net/ssrpsathira/2n5s4qx0/4
I tried logging the output from the API call for this address when selected from the autocomplete dropdown and there was really no street address value in the address components of the API response and yet I am not sure why the street address number is shown in the autocomplete text.
Is there something I am doing wrong, or is it just the API behaviour? I really need to get this fixed to show the house number of the address.
Thank you.
I am not sure this is a proper answer but it would be too long to put this as a comment.
Why does one work and the other not? I don't know, and IMO, both should not work.
Ellabella Ct, South Morang VIC 3752 seems to have only numbers from 1 to 8 registered on Google Maps and this seems to be consistent with another data source: http://www.street-directory.com.au/vic/south-morang/ellabella-court
Ellabay Crescent, Redland Bay QLD seems to have none. Try a search in the above website, it's not even on the map yet. Might be a new area? In any case, trying to reverse geocode any house on that street with Google Maps API returns just Ellabay Crescent, Redland Bay QLD 4165.
So I don't think there is anything wrong with your script, but maybe the data is just not up to date.
You can contribute to adding information on Google Maps. For that, please read https://www.localguidesconnect.com/t5/News-Updates/Exclusive-Edit-a-road-segment-in-Google-Maps/ba-p/149865
That still doesn't explain why it works in one case and not in the other when both street numbers seem to be unknown by Google...
You can file a new bug in the issue tracker if you think this should be corrected.

Receive Google Autocomplete Results in Local Language

Google JavaScript API V3 allows to change the language in either English, German or French, but when I search for "Cologne" in English API it should return me "Köln", same as if I search for "Frankfurt" in French, it shall return me "Frankfurt" and not "Francfort". People might search all across Europe and I want to get the specific results in each of the resulted cities' local language. How is that possible?
When using Autocomplete service via the JavaScript API,the API detects the browser's setting for the end user and sets the language appropriately. Please see our doc for reference:
https://developers.google.com/maps/documentation/javascript/localization
That being said, if you don't include the language parameter when calling the JS API, the language will default to the setting in the end users' browser. This would most likely be the local language for that user.
I hope this helps!
There is a way to do this, at least partially.
Let me start by pointing out the premises:
The Maps APIs and Google Maps will be consistent in the following.
Names of political entities are shown in the user's preferred language.
Street-level addresses are shown in the local language, with a script friendly to the based on its preferred language.
With these in mind, you can do the following:
Once users selects a city (place_changed event is fired), take the
types and location latlng of the city.
Do a reverse geocode of the location latlng of the city.
Search for results with location_type other than "APPROXIMATE".
In those results, search for the address_component with the same types as the city. That will be the name of the city, in the local language.
Examples: get "Köln" for a French user:
User types "Cologne" and selects "Cologne, Allemagne".
City has latlng 50.937531,6.960279 and types: ["locality", "political"].
Reverse geocoding of 50.937531,6.960279 returns 2 results with location_type other than "APPROXIMATE".
From the first result, 4th address_component has types: ["locality", "political"]. It's name is "Köln".
Note that names are always in a script friendly to the user, so you get "Beijing" for a German user (instead of "北京") or "Tōkyō-to" instead of "東京都".

Fetch Longitudes and Latitudes by walkthrough the MAP

I have a question and I don't know that is feasible or not. I tried hard but I am not getting any idea. Actually what I am doing is I am collecting the data for doing a load test. For that I am collecting several address. I got some of the longitudes and latitudes from one of the website. Based on these longitudes and latitudes I generated the address by using the Google Places API. But I need more data but I don't have any geolocations.
Here my questions are
Is there any way to get the address without mentioning the latitude and longitude by using google maps.?
Is there any way to get the addresses by walk through the google maps.? Say for example, in the google maps if I click San Jose, CA, United States we can see a mark in the google maps (Mark represents boarders of that place). Is there any way to get all the addresses from that mark. Say for example, I will mention one of the geolocation and based on that I will move north side by slightly increasing the longitude and latitude and in the same way after some time I will move some other side etc.
Is there any way to know the boarders of that place.?
Is there any way to get the address without mentioning the latitude and longitude by using google maps.?
You can try out Google Places API to search based on the address. You can search for places there and return Places that are likely to match the query.
Is there any way to get the addresses by walk through the google maps.? Say for example, in the google maps if I click San Jose, CA, United States we can see a mark in the google maps (Mark represents boarders of that place). Is there any way to get all the addresses from that mark. Say for example, I will mention one of the geolocation and based on that I will move north side by slightly increasing the longitude and latitude and in the same way after some time I will move some other side etc.
I think you may be referring to the oogle Maps Geocoding API for this one. It can convert addresses to coordinates and vice-versa (reverse geocoding)
Is there any way to know the boarders of that place.?
It seems to not be possible based on this SO ticket. However it did provide an alternative solution that may be similar to what you want to do.
Hope this helps!

Country restriction while using google place API nearby search

I'm creating a web application to search business organisations in an area. User will provide keyword and zip code for the search.
For searching, Place API Nearbysearch functionality is used. Latitude, longitude, radius and keyword are given for the request. I give radius of 10000. But while searching for businesses with a zip code of California, I got a business from Mexico also. I can't reduce the value of radius.
How can I get places only in the country of the zip code provided by the user?
It doesn't appear to be possible to filter Place results by country. None of the parameters for the API include a filter by geographic name.
https://developers.google.com/places/documentation/search#TextSearchRequests
What I would do is pull all results and filter results within your own code. The downside (besides your app doing more work and using more bandwidth) is that as you only get 20 results per page, you may have to pull multiple pages to get the desired number of results.

Does Google Maps API offer a way to search for locations by name?

When one visits http://maps.google.com, they are able to type queries into the search field and receive results based on locations or places, and not hard search results, as they would in a normal Google Search query. They're a unique style of result (names of places, locations) suited to the Maps interface for obvious reasons.
I've been digging through both the Maps and standard Google Search API for a couple hours now, and have done multiple searches on this question, and I can't seem to find the answer.
They obviously have the Local Search, but that's been deprecated, and it only yields results if you provide an initial lat/long. I want to be able to find places or locations with no initial lat/long.
Essentially what I want to do is allow a user to type in an address, name of a place or name of a city or state or a zip code, or essentially any other kind of location that is allowable on Maps, and geocode it. I feel stupid because this seems like it has to be there, but nothing I've seen in the API seems to do this.
I don't need the AJAX suggested results, necessarily. Just a way for a user to type in a nice name and geocode from it, though results as a user types would be ideal.
What am I missing here?
What you are looking is Geocoding API from google maps.
Find Documentation here
UPDATE 5/12/2011
Google just opened up public access to their Places API. This is more to the heart of the original question request:
https://developers.google.com/maps/documentation/places/web-service/autocomplete
I think you're looking for the google.maps.Geocoder class:
A service for converting between an address and a LatLng.

Categories