Google Places returns wrong city - google-maps-api-3

I am building an application using google autocomplete Places API.
If I use the predictive suggestion for the address "Pongal, New York, NY, United States", I get following items in the return place object:
locality: Manhattan
administrative_area_level_2: New York
administrative_area_level_1: New York
As per documentation of google Places at: https://developers.google.com/maps/documentation/geocoding/ For US, locality can be used to fetch the city or town and *administrative_area_level_1* can be used for State.
So, I get New York as state and Manhattan as city which is wrong since Manhattan is not the city, the city for this address is New York
May be I am asking too much from Google. But, Really appreciate any help on this since it breaks my system in later stages or Please correct me if I am doing something wrong.
Google Maps address link under the scanner: http://maps.google.com/maps?q=Pongal,+New+York,+NY,+United+States&hl=en&ll=40.748492,-73.976612&spn=0.017947,0.042014&sll=37.0625,-95.677068&sspn=38.365962,86.044922&oq=pongal&hq=Pongal,+New+York,+NY,+United+States&t=m&z=15&iwloc=A

Related

Determining if street address is within city limits

I am attempting to determine if a U.S. address is within city limits or not. (Another example is if an address resides within a particular county or not).
For example, we are creating a website allowing a city to sell its pet licenses. If, for example, the address is for W. Lafayette, Indiana, but the home is just outside of the established city limits, we want our website to be able to notify the user that they do not need to buy a pet license (otherwise when the city sees it, they need to refund that money to the pet owner).
Google Maps obviously knows city boundaries. For example, when you view W. Lafayette, IN, on the map you can see a red line and light red shading showing the city limits: (example)
My question: how do I determine if an address is contained within that bordered area? (I'm hoping for perhaps the ability to send lat/lng to an API to determine if it is contained within that region... or some other ideas as to how to do this?)
Side note: postal code is not enough. There are many instances where an address can have a city, state, zip that is the same whether the home is in or out of city limits.
Thank you.
Tom

Using Google Maps API to geocode NYC high schools by BN code

I am trying to geocode NYC high schools by using the Maps Geocoding API and the unique BN code assigned to each high school. For example, typing K733 into Google Maps results in a marker on MESA Charter High School in Brooklyn, NY. However, when I use the API url like so:
https://maps.googleapis.com/maps/api/geocode/json?address=K733
I keep getting "ZERO_RESULTS". I've also tried using the Places API and I've gotten the same results. Can anyone point me in the right direction? Is it even possible to pull this information from Google Maps?
It not possible to use unique BN codes for Maps Geocoding API because the address component requires postal address
address — The street address that you want to geocode, in the format
used by the national postal service of the country concerned.
Additional address elements such as business names and unit, suite or
floor numbers should be avoided. Please refer to the FAQ for
additional guidance.

Getting No response from google direction api

I am using google direction api to get direction/routes between two places.
When I query
http://maps.googleapis.com/maps/api/directions/json?origin=New%20York%20LaGuardia%20Airport%20Marriott,%20Queens,%20NY,%20United%20States&destination=200%20e%2057th%20st%20ny&sensor=false
Iam getting Status = NOT_FOUND.
But when I search this path from New York LaGuardia Airport Marriott, Queens, NY, United States to 200 e 57th st ny using https://maps.google.com/. Google display a direction path between these two places. You can see this via link: link
What should I do to get the reponse from google api.
Thanks.
Google Maps uses many sources of locations data including Places results. Look to me like the directions service can't find "New York LaGuardia Airport Marriott, Queens, NY, United States" (because it isn't an address). If I use the Places API, that can find it.
example using the javascript APIs

Geo-coordinates provider for European cities and districts

I'm looking for database with geo-data about city districts for all cities of the Europe.
I have plans to use it in my google-maps based appication.
For example, if you try to search with query "Paris, Paris 11" at Google Maps, you will see the highlighted area of Paris-11 district.
I've already found great database with country regions polygone: https://www.google.com/fusiontables/DataSource?dsrcid=420419
Can anybody help me with same database for city regions?
Or maybe google maps api has some method to receive polygonal coordinates of selected city district?
PS all national earth data-tables are stored here: https://www.google.com/fusiontables/DataSource?dsrcid=394713

Is there a way to get LatLng of a street within particular city using Google Geocoder?

I am writing an application which requires to put a marker on a street within one city. I've added an input for searching this particular street (to simplify the process and not have to drag and locate the street manually).
So, entering "[Street name], [City]" works as expected and locates the street perfectly. However enetering only "[Street name]" centers map on the street but in another city.
Is there a way to tell Geocoder to search in a particular city?
In the end I can manually add ", [City]" to the request but I'm wondering if it's possible through the API.
You can tell the geocoder to bias towards a particular area:
https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingViewports
Note: this is not entirely foolproof: it biases, it doesn't restrict. So if you look for "Downing Street" in a tiny village it may well find Downing Street in London anyway.
The only foolproof way is to force the city into the address.

Resources