Hi all, I've been searching far and wide for ages for an example to generate a list of geocodes based on a radius of a given geocode.
I must admit, the example I found was the only clear one. However, it doesn't work :( In fact, it didn't work straight out the box-example Google provided. I followed this example: http://code.google.com/apis/maps/articles/phpsqlsearch.html#findnearsql I managed to eventually find geo code data which seems to be valid when I cut and pasted them into googlemaps.com Here's a subset: code suburb state lat long 3065 Fitzroy Victoria -37.7833 144.9833 3066 Collingwood Victoria -37.8000 144.9833 3067 Abbotsford Victoria -37.8044 144.9997 I know for a fact that the bottom two records are well within a 5 kilometer radius of the suburb Fitzroy. So, I generated the SQL based on their example and came up with: SELECT *, ( 6371 * acos( cos( radians(-37) ) * cos( radians( -37.7833 ) ) * cos( radians( 144.9833 ) - radians(144) ) + sin( radians(-37) ) * sin( radians( -37.7833 ) ) ) ) AS distance FROM Geocode_AU HAVING distance < 5 ORDER BY distance Returns absolutely nothing :( Also why I don't understand is why they rounded some of the lattitudes and longitudes??? For example, they use -37 instead of the full -37.7833 and 144 instead of 144.9833. I also tried overwriting the rounded numbers with their full ones but also no luck. It returned the entire table. Does anyone understand what has gone wrong? Seems odd that Google would post an example that doesn't work!??? Kind regards, John -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
