Get timezones based on zipcode - timezone

I want to get the current time based on my input zipcode in php.
E.g. If i will enter 71020 then I want the accurate time of that location.
Is there any web service exists to which I can make a call by sending parameter as zipcode.
Please help me out.
Thanks

First use a service that will give you the latitude and longitude on a zip code. There are many, but an easy one is GeoNames. If you search here on StackOverflow or Google, you will find plenty of others.
Then take a look at the many different ways you can resolve a time zone from a latitude and longitude.

Related

Get Exact latitude,longitude against an address

I am using goole geocoding api to fetch latitude and longitude of a particular address, for some cases it gives me closest to my desired location while some time the position returned by google is many meters away from my given address.My main concern here to ask is, is google the best geocoding provider of there are any third party solutions provide accurate latitude, longitude?
My google API format is something like this
https://maps.googleapis.com/maps/api/geocode/json?address=[My address, street 123, house 123]&key=[GOOGLE_API_KEY]
Please help out, Thanks :)

Return Latitude and Longitude from an address

I have a list of a couple thousand addresses and I would like to find the Longitude and Latitude of each one. I know I can use websites such as google maps to individually search the geolocations, but I would like to know how to make one massive input of all the addresses(such as putting them all in one array) and get an array that returns the Longitude and Latitude of each in perhaps a corresponding array.
I know Java fairly well but no other languages.
I would prefer detailed instructions or coding that would allow me to do the actions described above.
Thank You
The company I work for has an Excel plug-in for address geocoding, no programming required:
https://www.yaddress.net/Home/Excel
SmartyStreets (disclaimer: I work for them) has a list tool specifically built for excel style address data. You can easily paste in your excel data of addresses and the list tool will verify each address as well as return information like the latitude and longitude. You can try it out here.

Given an address, how can I get the congressional district?

Is there a library or service that returns the US federal congressional district given a US address?
You can do this on govtrack.us. I am not sure if there is a code framework for this, but you could probably write one from this information.
Full disclosure - I work for a company that also provides congressional district data - smartystreets.com
Keep in mind that this information changes often and I have been looking for the last 4.5 years and haven't yet pinpointed an actual, absolutely reliable source for this data. All of the companies I have looked at, including mine, say that their source is the US Postal Service but no one in the US Postal Service has been willing to tell me how frequently the data is updated within their system and what their source might be. So, just be aware.
I'm one of the creators of Geocodio and we had this problem ourselves. So we made it part of our geolocation tools!
You can use the Geocodio API or spreadsheet upload to look up Congressional districts, Representative/Senator contact information, etc. Docs: https://www.geocod.io/docs/#congressional-districts
You can use the Sunlight Foundation Congress API, which is free to use. Go to: http://tryit.sunlightfoundation.com/congress You can determine congressional district by zipcode (not completely reliable since zipcodes can traverse multiple districts) or by latitude/longitude. Just use Google geocoding to retrieve lat/lng from your address, and then you can look up the congressional district.
The whoismyrepresentative.com/api site can translate a zipcode into a congressional district. You can do a call with the url below, replacing 10038 with your zipcode.
http://whoismyrepresentative.com/getall_mems.php?zip=10038&output=json
Hope that helps!
**Also note that the sunlightfoundation site returns a 404 error and govtrack.us does not have an api for searching for congressional districts.

How to get country name by using longitude and latitude?

I am working with a project, and so far it is possible to get longitude and latitude by using the phones GPS, and saving the values in variables.
I would like to get the names of all countries with help of longitude and latitude, and I have read about "Geocode" and "Geolocation", but I dont know how to implement this in my code.
Someone who can help me solve this problem?
What you are looking for is a "reverse geocoding" solution, which takes lat/lon coordinates and gives you back postal address including country. Reverse geocoding API is offered by all the usual providers -- Google, Bing, Yahoo, etc.

Resolve city code from user input

There are a lot of geocode services out there (like http://geo-autocomplete.googlecode.com/svn/trunk/demo/ui.demo.html for example) where user can write a location (or part of it) and it will be resolved to real existing location.
There is also a lot of info provided with the search result (like country ISO code, coordinates, etc..), but none of the services seem to provide country and city code.
What I mean is a code used to phone to certain are. For example Country code for Germany will be 49 and for city of Dusseldorf will be 211.
Is there any service, where I can get this info from the user input. Or is there any way to combine the two. For example I get city name from google geocode service and the try it on some city codes database. If yes, can anyone please provide me with links.
You can use for instance Yahoo's GeoPlanet. For more elaboration on services to solve your problem you might want to check out this answer on gis.stackexchange.com, which seems to cover the kind of service you need.

Resources