Hello Friends,

Google MAP API provides you the way to get Latitude, Longitude, IP Address if you provide the Address. This is called GeoCoding. Are you stuck where you want Address or Region code from Latitude and Longitude? Now, Google MAP API provides reverse way where you have to pass latitude/longitude and Google will give Address containing City, State , Region Code, Country in response. This is called Reverse GeoCoding.

Below is the PHP code for getting Region Code from latitude and longitude.

<?php
$url = “http://maps.google.com/maps/geo?q=30.28,-97.73&output=json&key=ABQIAAAAhdDokCu8GspRD8rZaYYaoRR5dndtY5oS-GFuRoRAautbbsCzexTbXFh0ItLJ_JAtzGaD1Nh8I-kRzQ”;
$json_content = file_get_contents($url);
$data = json_decode($json_content);
echo $data->Placemark[0]->AddressDetails->Country->AdministrativeArea->AdministrativeAreaName;
?>

rax rss Reverse GeoCoding Getting Address from Latitude/Longitude  rax twitter Reverse GeoCoding Getting Address from Latitude/Longitude  rax facebook Reverse GeoCoding Getting Address from Latitude/Longitude  rax myspace Reverse GeoCoding Getting Address from Latitude/Longitude