Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

GoogleMapsAPI - two ? on functions - accuracy and twp/range

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
rec9140
Smarty n00b


Joined: 03 May 2009
Posts: 4

PostPosted: Sun May 03, 2009 12:12 am    Post subject: GoogleMapsAPI - two ? on functions - accuracy and twp/range Reply with quote

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
View user's profile Send private message
rec9140
Smarty n00b


Joined: 03 May 2009
Posts: 4

PostPosted: Wed May 13, 2009 7:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
eakinasila
Smarty n00b


Joined: 21 Nov 2009
Posts: 2

PostPosted: Mon Nov 30, 2009 4:54 am    Post subject: Reply with quote

where can I get more information on this api
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP