Hi
I want to find the longitude and latitude of place with a the help to a zipcode. Can anyone tell me how to do that?
An example in actionscript what be very much helpful for me. Because i am making a project in Flex.
Regards Zee
Hi
I want to find the longitude and latitude of place with a the help to a zipcode. Can anyone tell me how to do that?
An example in actionscript what be very much helpful for me. Because i am making a project in Flex.
Regards Zee
Do you have access to a long/lat database? if not, i believe you can use the google maps API to do that lookup.
Oh .. I just noticed Chris' answer. I am not familiar with geonames. You might also want to get familiar with "http://freegeographytools.com/" which has a ton of geocoding, gps, etc. resources for a whole range of projects.
Ahhh ... I just visited Eric's blog post. That is excellent! I will definitely hook up with google for more details in a future project.
If you are looking for on demand geocoding, use Google. They provide a simple pox web service version.
I wrote a blog about this a while back. Check out this link for step by step instructions for using this simple geocoding.
Cheers, Eric
There are several places to get zip code databases, in several formats. Load it into your favorite RDBMS, and query away.
Alternatively, you can use someone else's web service to look up the value for you. Other answers have posted possible web services; also, geocoder.us appears to have support for ZIP code lookup now as well.
I got my solve you can also
function getLatLong($code){ $mapsApiKey = 'ABQIAAAAsV7S85DtCo0H9T4zv19FoRTdT40ApbWAnDYRE0-JyP5I6Ha9-xT9G5hCQO5UtOKSH5M3qhp5OXiWaA'; $query = "http://maps.google.co.uk/maps/geo?q=".urlencode($code)."&output=json&key=".$mapsApiKey; $data = file_get_contents($query); // if data returned if($data){ // convert into readable format $data = json_decode($data); $long = $data->Placemark[0]->Point->coordinates[0]; $lat = $data->Placemark[0]->Point->coordinates[1]; return array('Latitude'=>$lat,'Longitude'=>$long); }else{ return false; } }
Yea I think you can consider zip code databases, I am using zipcodeworld free database as I only need to get the city from a zip code. If you need longitude and latitude, maybe you can try their premium database service. The demo page: http://www.zipcodeworld.com/lookup.asp?country=1