|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rec9140 Smarty n00b
Joined: 03 May 2009 Posts: 4
|
Posted: Sun May 03, 2009 12:12 am Post subject: GoogleMapsAPI - two ? on functions - accuracy and twp/range |
|
|
Is it possible for a future version of the API to do :
1) Provide the GeoCode accuracy value from google to determine how accurate the value returned is?
2) A function to take lat/long and/or address and return township and Range for Florida.
If any one knows a way to do #2 with another PHP API, function I would love to know, as I really could use the twp/range from a lat/longs.
Thanks! |
|
Back to top |
|
rec9140 Smarty n00b
Joined: 03 May 2009 Posts: 4
|
Posted: Wed May 13, 2009 7:51 pm Post subject: |
|
|
I've modified the GoogleMapAPI to return the geocode accuracy as part of the array.
Code: |
function geoGetCoords($address,$depth=0) {
switch($this->lookup_service) {
case 'GOOGLE':
$_url = sprintf('http://%s/maps/geo?&q=%s&output=csv&key=%s',$this->lookup_server['GOOGLE'],rawurlencode($address),$this->api_key);
$_result = false;
if($_result = $this->fetchURL($_url)) {
$_result_parts = explode(',',$_result);
if($_result_parts[0] != 200)
return false;
$_coords['acc'] = $_result_parts[1];
$_coords['lat'] = $_result_parts[2];
$_coords['lon'] = $_result_parts[3];
}
break;
|
In the above after line 1304 add the following line as you see above:
Code: |
$_coords['acc'] = $_result_parts[1];
|
You can then query this via:
Code: |
$accuracy = $geocode['acc'];
|
I will have a function for FL TRS shortly.
Hope this helps others. |
|
Back to top |
|
eakinasila Smarty n00b
Joined: 21 Nov 2009 Posts: 2
|
Posted: Mon Nov 30, 2009 4:54 am Post subject: |
|
|
where can I get more information on this api |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|