How can I get a street from a zipcode using google API - google-maps-api-3

I want to use google API to get the street address from a zip code so that when a user fills out his zip code in my registration form I then can automatically fill the street of the user.
Thanks

You cannot, because there can be multiple street addresses for any ZIP code.
For example, look up "Beverly Hills, CA 90210" in Google Maps. You can see there are streets such as "Lomitas Avenue" and "Sunset Boulevard" for this ZIP code.

Related

how to get street coordinate from google map api?

I am trying to make a web app based on google map api.I want to put image icon at different position of street in map.
how wiil i get these street coordinate from google map api?
Please give your useful suggestion.
Thanks.
Google have a service called Geocoding - you send a request including an address, a google.maps.latLng, or a Place_ID and it returns an array with all three of them. they explain all about this here.

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.

Google Maps Api Airport Search

I am trying to get a list of nearby airports, given a certain location.
You can do this through the google places api and using types=airport.
The problem is that Google Places is self-policing so any tom, dick and harry can call themselves an airport.
Is there any way to determine whether an airport is real - through google maps?
I know I could double check against an airports database but then I'd be best just using an external database and only use google maps to plot their locations!!
thanks
Geonames will give you airports eg. a search centred on Central Park New York with a radius of 25 kms.
http://api.geonames.org/findNearby?lat=40.776902&lng=-73.968887&fcode=AIRP&radius=25&maxRows=100&username=xxxxx`.
You will need to open a (free) Geonames account to make it work.
Such a search would be in your "external database" category but as far as I know, the entries are not self-certified, so are possibly more reliable than Google's from what you say.
To verify Google results against Geonames results would need to develop and code your own comparison algorithm.

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.

Google Map from database

I am looking for some example to use google map for using in ASP MS Access. I need it for address listing , so map will get data from database.
Building no,
Street no.,
City,
Code,
Country
You can store address in your database as actual address string. Like
1600 Amphitheatre Parkway, Mountain View, CA
And when generating Google Map for it on a webpage - use Geocoding. Also you can store latitude and longtitude (maybe also as strings) for some addresses that will not be found (or found incorrectly / not precisely) through Geocoding.
PS. I am not an ASP dev. I work with mere PHP+MySQL, but thats how I used to store addresses for Google Maps on one tourist website project.

Resources