Geocoding with PHP and the Google Maps API
Article Comments (13 total)
cheers for the easy to use geocoder :)
Thanks for the article. You had mentioned something at the end about creating a caching solution. I have a table in my DB that containts the fields, (user_id, lat, lon) I want to be able to assign the returned latitude, and longitude with the highest accuracy to vaiables for easy database entry, I also want to be able to get the Address, city, state, and zip that is returned from the geocoder to maitain database consistancy. What syntax would I use and which class would I add it to to accomplish this task. I am not too familiar iwth OOP, so any help would be apreciated.
I uploaded all the files and tested test.php, but was stopped short by a fatal error message -- no cURL support on my server. I then edited Geocoder.php to make it use fopen() instead of curl functions and it seems to work.
I am uncertain, though, if the original and my version work exactly the same. Maybe someone can advise?
<?php
// Geocoder.php
// I changed lines 32-35 ...
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// ...into...
$handle = fopen($url, "rb");
$response = stream_get_contents($handle);
fclose($handle);
?>



Hi There, I would like a user to find a specific address then also have a list of all the suburbs within a 15km radius of that address? Has anybody got a clue or something similar? Much Appreciated...