Chris,
With a few modifications unique to how I WANT IT TO FUNCTION THAT WORKED LIKE A 
DREAM

Thanks for the input!

Dave


-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Chris Davis
Sent: 13 September 2016 16:33
To: [email protected]
Subject: RE: Google API for Geocoding ... Again

FUNCTION geocode
LPARAMETERS lcpostcode

lcurl="http://maps.googleapis.com/maps/api/geocode/json?address=##ADDRESS##";

lojson=NEWOBJECT('json')

lctempurl=STRTRAN(lcurl,"##ADDRESS##",STRTRAN(ALLTRIM(lcpostcode)," ",""))
lcget=httptostr(lctempurl)
lcret=""
        loquery=lojson.decode(lcget)
        IF ALLTRIM(loquery.get("status"))="OK"
                loresult=loquery._results.get(1)
                logeo=loresult.get("geometry")
                loloc=logeo.get("location")
                
lcret=ALLTRIM(TRANSFORM(loloc.get("lat")))+","+ALLTRIM(TRANSFORM(loloc.get("lng")))
        endif
        
RELEASE lojson

RETURN lcret

Json code is from https://github.com/sait/vfpjson Httptostr is part of 
vfpconnection from sweet potato



-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Dave Crozier
Sent: 13 September 2016 16:26
To: [email protected]
Subject: RE: Google API for Geocoding ... Again

Alan,
Your solution worked like a dream, thanks. Just knocking it into a useable 
class now to allow input and output from our system within the daily 
constraints set by Google on free accounts.

Looks like I won't have to pull any more of my "minimalist" hair out tonight!!

Dave (& Tom)


-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Alan Bourke
Sent: 13 September 2016 16:15
To: [email protected]
Subject: Re: Google API for Geocoding ... Again

Or you can just use the WinHTTP library in Windows as per the Gist I linked 
earlier, and get a string back straight into VFP. The hardest part of all this 
is going to be parsing the JSON to be honest.

--
  Alan Bourke
  alanpbourke (at) fastmail (dot) fm

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to